Skip to content

Label

{name}:

Also searchable as: Label · labels · jump target

A label is a word followed by a colon, on a line of its own. goto jumps to the line after it.

set %n 0
mainloop:
set %n %n + 1
if %n < 3
goto mainloop
display ok Went round %n times.
halt
  • Names: case does not matter, and goto can leave out the colon: goto mainloop.
  • Nothing else on the line except a comment (mainloop: ; main loop). The label line itself runs nothing, so a command written after the label on the same line is ignored.
  • Duplicate names are allowed, but goto takes the nearest one. See goto.

See also

Based on the EasyUO wiki, edited for EasyUO Reforged. This text is available under the GNU Free Documentation License 1.2.