Skip to content

Else

else
else {lines}

Also searchable as: Else

else runs the line or block after it only when the if before it was false. When the if was true, the script skips it.

Parameter Meaning
lines Optional. Without a block, how many of the following lines belong to the else. Default: 1.

Put else right after the line or block of its if. Blank lines in between are fine; any other line in between breaks the pairing.

A block is a { line, the lines to run, and a matching } line. The { has to be the very next line: a blank line or a comment in between means only that line belongs to the command, and the block after it runs every time. Braces go on lines of their own.

set %a #false
if %a
display ok a is true
else
display ok a is false ; this one is shown
halt

See if for blocks, the line-count form and nesting.

See also

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