Goto

Changes the flow of control in a WIL program.

Syntax:

Goto label

Parameters:

(s) label user-defined identifier.

 

Goto label causes an unconditional branch to the line in the program marked :label, where the identifier is preceded by a colon (:).

Note: Program flow control structures, such as For/Next, ForEach/Next, While/EndWhile, Switch/EndSwitch, If/EndIf must not be "jumped" by a Goto statement. If a Goto is used inside of one of these structures to send the flow of control outside of the structure, or if a Goto is used to send the flow of control inside a structure, errors will result.

Labels for Goto and Gosub can be up to 249 characters.

Example:


If WinExist("Solitaire") == @FALSE Then Goto OPEN
WinActivate("Solitaire")
Goto loaded
:OPEN
DirChange(DirWindows(1))
Run("C:\Program Files\Microsoft Games\Solitaire\Solitaire.exe", "")
:loaded
See Also:

For, If, Switch, While