if

Syntax

if (expression) {BLOCK}

if (expression) {BLOCK} else {BLOCK}

Parameters

Parameter
Definition
BLOCK one or more MSL statements that are executed once in accordance with the evaluation of the if or else if expressions
expression MSL statement that evaluates an expression and returns either true or false

Description

The if statement conditionally executes a BLOCK of code.

Example

if (y = 10) {
    x = 1
}


if (foo < bar) {
    small=foo
} else {
    small=bar
}