Monkey Documentation

Keyword Then

Optional separator used for readability in If blocks.

Syntax

If expression [Then]
Statements...
Endif

If expression [Then] Statements...

Description

The keyword Then allows separation of expression and statement(s); however, its only function is to aid readability according to programmer preference and it can be safely left out.

See also

If

Examples

' Simple variable check:

        If a = 1 Then
                Print "a equals one"
        Endif

' Single-line example, using Then:

        If a = 1 Then Print "a equals one"

' The 'Then' separator is optional:

        If a = 1 Print "a equals one"