Exit
exit ends the script it is in:
- In a script started with
call, the calling script goes on with the line after itscall. - In the main script, the script starts over from the first line. It does not stop: use
haltfor 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.
Example
Section titled “Example”set %round %round + 1display ok Round %roundif %round < 3 exit ; back to the top of the scriptdisplay ok Done after %round rounds.haltReturning a value from a called script
Section titled “Returning a value from a called script”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 scriptset %a 0call a.euodisplay ok a = %ahaltset %a set_by_a.euoexitSee also
Based on the EasyUO wiki, edited for EasyUO Reforged. This text is available under the GNU Free Documentation License 1.2.