# GOSUB OF / GOTO OF

Syntax:

Then: GOSUB (num_expr) OF label1, label2, ...
Then: GOTO (num_expr) OF label1, label2, ...

"num_expr" is an index into the list of labels (starting at 1).
"label1,label2, ..." are the labels where processing branches to.

Only the integral portion of num_expr is used. Any fractional portion is ignored. The number is not rounded.

If "num_exper" is less than 1, or greater than the number of labels, the gosub/goto is not executed, and processing falls through to the next statement.

NOTE: The parentheses around (num_expr) are required.

Version Ref: 4.5

Description:

Gosub/goto one of a list of labels.

Examples:

Handle different types of records, assuming field "rectype" contains "A" , "B", or "C".

(Note that "A" has an ASCII value of 65.)

Then: GOSUB (asc(rectype) - "64") OF RecTypA, RecTypB, RecTypC