Goto
goto makes the script go on at the line after a label.
Parameters
Section titled “Parameters”| Parameter | Meaning |
|---|---|
label |
Name of the label, with or without the trailing :. Case does not matter. |
Which label
Section titled “Which label”goto looks for the label starting from its own line, one line further each step, forward and backward
at the same time, and takes the first match. At equal distance the forward one wins. So if a label name is
used twice, the nearest one is chosen, not the first one in the script.
When no label matches, nothing happens and the script goes on with the next line.
Examples
Section titled “Examples”loop: if %done goto finished gosub workgoto loop
finished:display ok Done after %rounds rounds.halt
sub work set %rounds %rounds + 1 if %rounds = 3 set %done #truereturnA switch built from labels. The comma glues case and the number into one label name:
set %a #random % 3 + 1goto case , %a
case1: display ok One goto case_endcase2: display ok Two goto case_endcase3: display ok Threecase_end:haltSee also
Based on the EasyUO wiki, edited for EasyUO Reforged. This text is available under the GNU Free Documentation License 1.2.