×
Menu
Index

GOTO Keyword

 
Usage:
GOTO label
 
Description:
Use the GOTO keyword to jump to another line in the current script. A GOTO line is identified by a symbol followed by a colon (:). The GOTO statement and the label being jumped to must be within the same subroutine.
 
NOTE: Caution must be taken when jumping into or out of a loop such as a FOR..NEXT or WHILE..WEND loop.
For example, if you jumped into a FOR..NEXT loop, execution would continue until the NEXT is encountered, which would produce a "NEXT without FOR" error because the FOR keyword was skipped.
 
Example:
sub main()
   printl("This line gets executed")
   goto jump
   printl("This line does not get executed")
jump:
   printl("This line also gets executed")
end sub