Conditions
If Then Else
The following scripts are equivalent:
In the case of multiple conditions placed in and, the evaluations are made in the written order, and the program stops at the first false condition found; in the case below, if ConditionA is false the other two conditions are not evaluated (therefore, in case of instructions, they are not executed):
If CondizioneA & CondizioneB and CondizioneC
Examples:
<>
mathematical operator means “different from”;for example if you want check if a string is not null:
The exclamation mark corresponds to
not
Inline conditions
To put an “inline” condition, for example in the selection fields of an object, you can use string
or to make a value appear only for a certain transaction:
string$
or to make a value appear only for a certain transaction:
string$(GFLAG='YOFQ',[F:POH]YPOHORE)
Loops
You can use two forms of loops,
For…Next
and
While…Wendwith different syntaxes based on the cases.
and
While…Wendwith different syntaxes based on the cases.
See below some examples
Loop on numerical variable
The step if not specified is 1.
Loop on alfanumerical variable
Loop on table
Break
It is possible to use the
break
keyword to interrupt the cycle:Multiple conditions
The Case statement can be used to manage multiple conditions: