Command: if

Syntax

if (<condition>) <command_block>

Description

Execute a command or block of commands on the successful value of a condition.

Parameters

Switches

None

Notes

Any non-zero numeric or point, or any non-null string is considered true when evaluating <condition>.

This command may be tied to an else statement which will be executed if <condition> is false.

Examples

Execute one command.

if (x = 5) !Correct

Execute a command block.

if (x = 5) {
    numeric y = 20
    !Have set Y to 20
}

See Also

Commands:

else, unless

Identifiers:

cond_precision (numeric)