Skip to content

Exit

exit

Also searchable as: Exit

exit ends the script it is in:

  • In a script started with call, the calling script goes on with the line after its call.
  • In the main script, the script starts over from the first line. It does not stop: use halt for that. Variables keep their values.

Reaching the last line of a script does the same as exit. That is why a main script that should run once ends with halt, and why a script without one runs again and again.

set %round %round + 1
display ok Round %round
if %round < 3
exit ; back to the top of the script
display ok Done after %round rounds.
halt

exit cannot return a value the way return does from a sub. Set a variable instead; called scripts share their variables with the script that called them.

; main script
set %a 0
call a.euo
display ok a = %a
halt
a.euo
set %a set_by_a.euo
exit

See also

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