On ... Goto


On index Goto LINE { , LINE ... }

If index is zero execution drops down to the next line.

If index > 0 then the execution will be will be transferred to the corresponding label following the Goto. The first label is executed if index equals one.

The On ... Goto command can only be used to transfer control to a line label. It can not be used to call the new Sub type subroutines.

Index = 2
On Index Goto One, Two, Three
End

One:
Print "One"
End

Two:
Print "Two"
End

Three:
Print "Three"
End







Become a Patron