Keyword Elseif - leonard-thieu/monkey GitHub Wiki

Where the initial expression in a conditional block proves False, ElseIf allows for the testing of another expression, executing an alternative section of code should that expression prove True.

Syntax

  If Expression [ Then ]    Statements...   ElseIf Expression [ Then ]    Statements...   EndIf

Description

Where the initial expression in a conditional block proves False, Elseif (or, optionally, Else If) marks the beginning of an alternative program execution path, whereby the statements following will be executed, but only where the Elseif expression is True.

See also

Examples

' Simple If check with alternative program flow dependent on a positive Elseif test:

If a = 1
    Print "a equals one"
Elseif a = 0
    Print "a equals zero"
Endif