Skip to main content

10.4.2.5. ON~GOTO

10.4.2.5. ON~GOTO

 

Explanation

Branching to various addresses according to the condition number after ON.

Grammar

ON <num.> GOTO <addr>[,<addr>,<addr>,..]

Parameter

num.

Arithmetic formula. This number determines the address for branching.

If this number is real number, drop numbers after the decimal point. If the number is less than 1 or more than the number of addresses, the next statement is processed.

Add.

The address is branched as follows: If condition formula is one, the first address, if two, second… The addresses can be inputted up to 10.

Example

ON V5% GOTO 210, 220, *CONT

    GOTO *ERR

210 PRINT #0, "V5%=1"

    GOTO *CONT

220 PRINT #0, "V5%=2"

*CONT