When you Run a diagram,
First, or when you click the Reset button ControlDraw generates a complate Visual Basic Script for the page.
Declarations from the Globals in the Script form
Declarations from each Symbol
A subroutine for each symbol containing the script determined by the Symbol Script but converted to use VBS Dictionary objects
A subroutine for to build the the associated matrices
A page level subroutine is then generated that calls each symbol in turn. The order that is used depends on the connections on the between the objects, with upstream objects being called before the downstream ones.
Note that if there is a loop this may not produce the fastest result.
VBS Dictionary objects - these are data arrays that map to the symbols on the diagram into the script using the unique id of the diagram object. The Symbol and matrix scripts are translated by by changing names to their dictionary values
Each Symbol becomes an entry in Dictionary ObjVals eg TheValue maps to ObjVals("Obj+Symbol ID")
Each Symbol input or output becomes an entry in Dictionary Params ("Sig+Connection point ID")
Each Connection becomes an entry in Dictionary LinkStates ("Lnk+Connection ID")
Each Step becomes an entry in Dictionary dicTokens ("tok+Symbol ID")
Each Transition becomes an entry in Dictionary dicTransitions ("tra+Symbol ID")
Each Transition becomes an entry in Dictionary dicSFCBranches ("bra+Symbol ID")
Note - For SFC Steps, the code is only executed when the step is active