Code



Function:
Code phase is used to access data, jump to a new phase according to a condition or change the value of varibles. It use the same syntax as Visual Basic.


Figure 1 - Codes to read data from table to varible

Supported function:

ReadField

There is a wizard for this function. Following parameters should be specified.
Search by field:

The field to locate the record

Search by varible:

The varible used to locate the record together by the first parameter.

Read from field:

The field from which the data is read.

Varible to store data:

The varible used to store the data read from the field.

Varible to flag if the record found:


The varible which will be set true if the record found, else it will be set false.

WriteField

There is a wizard for this function. Following parameters should be specified.
Search by field:

The field to locate the record

Search by varible:

The varible used to locate the record together by the first parameter.

Write into field:

The field which will be written.

Varible to store data:

The varible used to store the data which will be written into the field.

Varible to flag if the record found:


The varible which will be set true if the record found, else it will be set false.


GotoNewPhase

Adding this function in your code will create a new phase node as a son node of the code phase node in the flow tree. When the function is called, the flow will be turned to the son node. This function often used together with If ... Then structure;

If ... Then structure

Form:

If ... Then
....
End If

For example:
If bStudentFound=false Then
goToPhase 4
End if

Son Phases:

OnFinished:

After the code is finished, the flow will goto the this phase.

OnError:

When an error occured while executing the code, the flow will goto this phase.

OnCodeJump:

When a GotoPhase function is called, the flow go to this phase.
Their might be multiple such son phases, each corresponding to a GotoPhase function in the code lines.