Visara Master Console Center Scripting Guide User Manual
Page 135

Chapter 5 Script Commands
Scripting Guide
135
IF
Syntax:
IF...[ELSE...]ENDIF
IF
Expression
Group
1
command
[More
group
1
commands]
[ELSE]
Group
2
command
[More
group
2
commands]
ENDIF
Description:
Evaluates an expression for TRUE or FALSE—if...then statement.
Action:
If Expression evaluates to TRUE, then the Group 1 command(s) are
executed. If Expression evaluates to FALSE, then, if specified, the
Group 2 command(s) are executed.
Parameters:
Expression. Boolean expression. The expression to evaluate. Refer
to Boolean on page 50 for more information.
Returns:
N/A.
Notes:
1. The number of nested IFs is unlimited.
2. The number of commands allowed in each section (the TRUE or
FALSE sections) is unlimited.
3. The following command is invalid but will not generate a compiler
error:
IF %A=1 or 2 or 3
Example:
IF %Number == 100
LOG( LOG_FLT, “Numeric variable is 100”)
ELSE
LOG( LOG_FLT, “Numeric variable is not 100”)
ENDIF
IF $MsgText[ 1] == “ERROR” AND $MsgText[ 2] == $SrchText
//additional commands here
ENDIF
IF %Number <= 250
LOG( LOG_FLT, “Numeric variable is less than 250.”)
ENDIF
IF %Number != 0
LOG( LOG_EXEC, “Numeric variable does not equal 0.”)
ENDIF
See Also: