PWCT Docs Environment Reference

PWCT Environment and the Goal Designer

Detailed reference for every window, menu, dialog, and tool in the PWCT development environment.

PWCT Environment and the Goal Designer

When we run PWCT, we see the next window:

Goal Designer

The following table explains the window items:

IndexDescription
1Window Title and the active visual source file name, Start.SSF
2Menubar
3Toolbar
4Main windows (Server Units, Goal Designer, Transporter Designer, Interaction Designer)
5Statusbar
6Button to open the Log Window
7Child window title (Goal Designer)
8Child window (Goal Designer) buttons – Group 1
9Child window (Goal Designer) buttons – Group 2
10Component Name and Domain Tree of the selected step
11The Steps Tree
Select the Active Visual Programming Language

From the combobox you can change the active Visual Programming Language:

VPLTarget Language
HarbourPWCTHarbour
SupernovaPWCTSupernova
CPWCTC
C#PWCTC#
PythonPWCTPython
WebPWCT Under DevelopmentHTML, CSS, JS & PHP
VPL Selection
Server Units Window

Using HarbourPWCT, your application is a Server. The Server Units Window manages the Server Units with a combobox to select items, a Units Tree containing four units (Data, Code, Veto & Goal), and buttons to Add, Edit, Delete, Move Up, Move Down & Search.

Within the Details tab you see the server name (e.g. Server1). Command-line parameters are stored in variables SP1SP8. Sub tabs (Data Unit, Code Unit, Veto Unit & Goal Unit) provide information and statistics: number of Atoms, Shells, SubShells, Vessels & Reactions in the Data Unit; Circuits, Branches & Resistances in the Code Unit; Connections, Channels & Vetos in the Veto Unit; and Goals in the Goal Unit.

Server Units - Details

In the Code tab you write the resistance code. Each resistance is a block of code. Call a resistance with: Call Resistance Circuits\CircuitName\BranchName\ResistanceName. The code can be replaced by a goal from the Goal Unit.

Server Units - Code

The Compile tab controls the visual source type (Console or GUI). The "Server Extension" checkbox determines whether the source is a complete application or a sub-part. When disabled, Ctrl+R runs the application; when enabled it generates only the source code file for linking.

Run options: Call Main Resistance (executes the main code block) or Server FireOn (executes circuits sequentially, respecting circuit/branch switches).

Three buttons are available: Generate (produces source code), Build (generates + compiles), and Run (generates + compiles + executes).

Server Units - Compile

The Info tab provides an edit box for comments.

Server Units - Info
Search In The Server Units

From the Menubar → Edit Menu, open the Search window to find items in data, code, veto and goal units.

Search Server Units
New File Window

When using HarbourPWCT with the Goal Designer active, create a new file from the toolbar, menubar, or by pressing Ctrl+N:

New File Window

Select a template to create Console/GUI applications by writing code (Resistance Code) or without coding using the Goal Designer. Templates for database applications using OOP and ADO are also available.

Press Enter, double-click an item, or click "Create" to use the template. Use + and buttons to add/remove templates.

New Template

Define a new template and add it to the template list. Provide a template name and file (type the name or browse for it).

New Template
Components Browser

Select a component to generate steps in the Steps Tree. First select a domain from the Domain Tree, then choose a component from the related list. Interactive search finds components as you type. Use Enter, double-click, or "OK" to confirm; Esc or "Cancel" to abort.

Components Browser
Interaction Using Transporter

Enter data into interaction pages (data-entry forms). Click "OK" or press Ctrl+W to finish and see generated steps. Click "Again" or Ctrl+A to reuse the same component. Navigate multiple pages using buttons or the pages combobox. Right-click in textboxes for shortcuts (color, font, object selection, etc.).

Interaction using Transporter
Form Designer

Open the Form Designer from the Goal Designer using the button or Ctrl+F. If multiple windows exist, select one first. Design the UI using "Add Control", double-click or "Modify" to edit interaction pages. Move/resize controls via keyboard or mouse. Set font, text color, and back color for one or more controls. Layout options: Align, Size, Move, Spacing and Resize. Click "Save" or "Cancel" when done.

Form Designer
Set Steps Colors

Click the "Steps Colors" button in the Goal Designer. Select step colors by type, choose from preset styles, and hide certain step types to reduce visual clutter (e.g. hide "Generated Leaf" steps when reading the tree).

Steps Colors
VPL Compiler

Run the VPL Compiler from the Goal Designer to detect errors in the visual source. Errors typically occur when working with the Syntax Directed Editor turned OFF. After compilation you see the count of Interactions, Steps, and Errors.

Detectable errors:

Error Message
Error : Step ("Step Name") Enable/Ignore status is not correct
Error : Step ("Step Name") is not expected to be in this order
Error : Step ("Step Name") order is not correct
Error : Step ("Step Name") Contains Bad Substep
Error : Step ("Step Name") is duplicated
Error : Step ("Step Name") Parent is not correct
VPL Compiler
The Time Machine

The Time Machine button in the Goal Designer lets you play the program as a movie – watching the Steps Tree being built step by step, from selecting components to entering data in interaction pages. You can stop, continue, and run the program at any point to see runtime results. The voice reads step names (can be toggled on/off), and you can choose to view steps only (no interaction pages/components browser).

Additional options include refreshing the steps tree after updating visual components and running the documentation generator to create HTML tutorials explaining the program step by step. This generator has been used to create thousands of tutorial pages available online.

Time Machine
Search and Replace in the Steps Tree

Open the search window from the Goal Designer's search button. Find steps by typing part of the Step Name and/or Step Data, and perform replace operations on the steps tree.

Search and Replace
Interaction Designer
Interaction Designer

Design interaction pages used by visual components (transporters). Pages are data-entry forms with Label, Textbox, Checkbox & Listbox controls. Textbox values are stored in named variables. Checkbox variables are 1 (active) or 0 (inactive). Listboxes have configurable items, defaults, and return either text or index.

The left toolbar adds controls. The Properties tab (toggled via button) sets control properties. The Objects Combobox lists all page objects. Right-click the page region to set page color/picture. Move and resize objects with mouse or via the Properties tab.

When active, the File menu works with *.IDF files. Most pages are generated via the Interaction Pages Generator, then refined in the designer. Import listbox items individually or from text files.

Interaction Designer - Controls

Special keywords: <DEFAULT> sets the default control, <AUTONUMBER> requests an automatic name, and <LISTBOXDEFAULT> in an item name sets the default listbox selection.

Transporter Designer

The visual component in PWCT is called the Transporter. It takes input from interaction pages and transports it to the code mask interpreter. The code mask is a script controlling visual representation (steps) and text-based source code generation. Matching connects interaction page variables with code mask variables. Rules define component relationships and are used by the Syntax Directed Editor and VPL Compiler.

The designer displays the active *.TRF file and has 4 tabs:

Tab 1 – Interaction Pages: Each page has a name and an *.IDF file. Use Add, Edit & Delete. The "Open" button opens a page in the Interaction Designer. "Install Component" adds the finished component to the Domain Tree.

Transporter - Interaction Pages

Tab 2 – Code Mask: Write the code mask script in the RPWI scripting language. Right-click to list all available instructions.

InstructionDescription
<RPWI:POSITIVE>Execute block when test result is TRUE
<RPWI:NEGATIVE>Execute block when test result is FALSE
<RPWI:VALUE>Set the test condition value (e.g. "1" or "0")
<RPWI:TEST>Start a test block with variables to test
<RPWI:ENDTEST>End a test block
<RPWI:PUTMARK>Store active step number in a register (1–20)
<RPWI:SETMARK>Set active step from a register (1–20)
<RPWI:NEWSTEP>Create new step in the Steps Tree
<RPWI:SELECTSTEPBYNAME>Select parent step by name
<RPWI:TABPUSH>Add nested level to generated source code
<RPWI:TABPOP>End nesting level
<RPWI:NOTE>Add a comment
<RPWI:NEWVAR>Create new variable
<RPWI:SETVARVALUE>Set variable value
<RPWI:SELECTVAR>Select active variable
<RPWI:REPLACEVARSWITHVALUES>Replace code mask variables with their values
<RPWI:IGNORELAST>Remove trailing characters from generated code
<RPWI:IGNORELEVEL>Set level for IGNORELAST (current step or parent)
<RPWI:INFORMATION>Add information to the generated step
<PWCT:TOFILE>Start code generation to a file (set file name)
<PWCT:ENDFILE>End the file generation block
<PWCT:ADDVAR>Add a variable for code-extraction-time replacement
<PWCT:SETVAR>Set the variable name
<PWCT:MERGENEXTTOPREV>Merge next code line into previous
<PWCT:IGNORELAST>Same as RPWI:IGNORELAST, but at extraction time only
< >Wrap variable names or instructions between < and >
generated codeAny text not a variable or instruction is output directly
variables in codeInsert variables replaced with values from interaction pages or code mask
nested tests<RPWI:TEST> blocks can be nested
test conditionVariable(s) compared against the test value
Transporter - Code Mask

Tab 3 – Matching: Match interaction page variables with code mask variables. Select two variables and click the Down button, or use automatic matching when names are identical. Delete matches by selecting and clicking "Delete".

Transporter - Matching

Tab 4 – Rules: Control relationships between components. Rules determine parent/child component types and which step allows adding child steps.

RuleDescription
AllowParent:RootParent must be the Start point (nested comment steps like "The first step" also allowed)
AllowParent:GeneralNo parent restrictions – any parent allowed
AllowParent:CustomSpecify allowed parent components by name
AllowInteraction: NDetermine which step allows adding child steps
Scope: GeneralAfter AllowInteraction – no child restrictions
Scope: CustomSpecify allowed child components by name
Allow: nameAdd a component to the allowed list
EndEnd the allowed components list
Allowroot: NSet a step as another root step
NoDuplication: varPrevent duplication of an interaction page variable
Scope: ParentAfter NoDuplication – check duplication within parent only
Transporter - Rules