PWCT Features Ė Compatable (Optional)
When we program using PWCT to create our applications using Visual Programming (VP), we donít write the text based source code directly where this code is generated by PWCT while we are using the visual programming language components.
We can see/edit the generated source code and we can insert new code but we donít need to do this in order to create our applications where the visual programming language components must be enough to wrap the text based programming language features.
To see the step code, Inside the goal designer, select the step then click on the step code button.
Fig. 1 CPWCT
To see the code behind the step (For x = 1 ; x <= 10 ; x++) at first select the step then click on the Step code button
Fig. 2 Step Code
Here the code is read only, if you want to modify the code, Disable the Syntax Directed Editor.
You can create new steps inside the steps tree for Comments and/or organization, Another usage of this feature is to create a step for inserting a block of code.
When you run your program, the text based source code is generated, the source files is not deleted and you can see it in the application folder beside the visual source files (*.SSF & *.FPT)
When you uses CPWCT, the generated source code files will be *.C & *.H
Table 1. Generated source code files for each VPL.
You can Save, build & run the application or just generate the source code.
Fig. 3 Generate Source Code
If the visual source file contains more than one goal, generating the source code will generate the code behind all of the goals.
If you want to get the code behind one or more of goals, you can use the code extractor program
Fig. 4 running the code extractor application
Fig. 5 Select the Goals
Fig. 7 The Code Extractor application
Another feature here, you can get the steps tree as a text, if you want to copy it then paste in a forum while asking a question or providing an answer.
Fig. 8 Getting the steps tree as text.
The previous example is done using CPWCT, from the toolbar we can change the active visual programming language to use any one of them like HarbourPWCT, PythonPWCT, SupernovaPWCT & C#PWCT.
We can extend PWCT to support any text based programming language, also we can extend any of these visual programming languages by creating new visual components.
Fig. 9 Changing the active visual programming language (VPL)