Page History
...
On...GoSub is an efficient form of branching based on an index. It compiles as a jump table (as compared to the Case construct which offers comparative functionality, but is compiled as a series of nested If statements).
See also
GoSub, GoTo, Locate, On...GoTo, Return
Remarks
Code Block |
---|
labels = "LABEL1,LABEL2,LABEL3,LABEL4" locate input_parm in labels Using "," Setting POS then On Pos GoSub LABEL1, LABEL2, LABEL3, LABEL4 end return LABEL1: * Code of some type Return LABEL2: * Code of some type Return LABEL3: * Code of some type Return LABEL4: * Code of some type Return |