📖⚡ON GOTO

Use a lookup table to determine which line of code to GOTO.

This command is not recommended as it uses outdated GOTO command.

Try and use 📖⚡ON GOSUB instead.

Syntax

ON ByteVariable GOTO (Label0 , Label1 , LabelN)

Example

 

' ON GOTO Example
' OnGOTO.txt
' This command is not recommended: See ON GOSUB instead

DO

  ' GOTO each subroutine
  FOR B0 = 0 TO 2 

    ON B0 GOTO (Sub0, Sub1 , Sub2 )
    Continue:

  NEXT 

LOOP 

Sub0:
  TOGGLE 0
  GOTO Continue

Sub1:
  TOGGLE 1
  GOTO Continue

Sub2:
  TOGGLE 2
  GOTO Continue


Related Commands: