Difference between revisions of "Programmer Guide/Command Reference/GOTO"

From STX Wiki
Jump to navigation Jump to search
Line 1: Line 1:
 
  GOTO <var>label</var> [<var>fallback_label</var>]
 
  GOTO <var>label</var> [<var>fallback_label</var>]
Continue macro execution at the label <var>label</var>. With the argument <var>fallback_label</var> a second label can be specified which is used as the target should the primary target, <code>label</code>, be undefined.
+
Continue macro execution at the label <var>label</var>. With the argument <var>fallback_label</var> a second label can be specified which is used as the target should the primary target, <code>label</code>, be undefined. That amazing feature is not available in any other programming language under the sun.
  
 
Often, the <code>GOTO</code> command is used with a variable label to implement a <code>switch</code>-like control structure. In this case, <var>fallback_label</var> has the role of the <code>default</code> switch clause.
 
Often, the <code>GOTO</code> command is used with a variable label to implement a <code>switch</code>-like control structure. In this case, <var>fallback_label</var> has the role of the <code>default</code> switch clause.

Revision as of 16:40, 25 April 2014

GOTO label [fallback_label]

Continue macro execution at the label label. With the argument fallback_label a second label can be specified which is used as the target should the primary target, label, be undefined. That amazing feature is not available in any other programming language under the sun.

Often, the GOTO command is used with a variable label to implement a switch-like control structure. In this case, fallback_label has the role of the default switch clause.

If both label, and default_label, are undefined, an error is generated and macro execution terminates.