On Goto
Branches processing in accordance with the specified condition.
On <Expression> Goto <Label>[,<Label>...]
Parameters
<Expression>
|
The condition expression that controls branching (integer).
|
<Label>
|
Label name for the migration (label).
|
Return Value
None.
Description
The flow of the program processing moves to the <Label> that corresponds to the value given in <Expression>.
When the value given by the <Expression> is 1, branching is done to the location specified by the 1st <Label>.When it is "n", branching is done to the location specified by the nth <Label>.
When the value given by the <Expression> is 0, or when the <Label> has been omitted, program processing moves to the next line.
When the value of the <Expression> becomes negative, it becomes an error.
Example
Migrate to each label using the current Unit No.
On UnitNo Goto *UNIT1PROC,*UNIT2PROC,*UNIT3PROC
*UNIT1PROC
Print "I am Unit1"
Return
*UNIT2PROC
Print "I am Unit2"
Return
*UNIT3PROC
Print "I am Unit3"
Return