IF...THEN...ELSE

System Testing Test Script Language.

Syntax

IF <condition> THEN

ELSE

END IF

Description

This is a control statement. The simplest form of an IF instruction begins with the keyword IF, is followed by a Boolean expression, and then the keyword THEN. A set of instructions follows. These instructions are executed if the expression is true. The last END IF marks the end of the set of instructions.

Other actions can be executed depending on the value of the condition. Add an ELSE block, followed by the set of instructions to be executed if the condition is false.

IF may be placed anywhere in the test program.

THEN must be placed at the end of a line.

ELSE must be on its own line.

END IF must be on its own line.

Example

HEADER "DEMO SOCKET RPC","1.0a", "2.5"

#int sock;

INITIALIZATION

...

IF (sock==-1) THEN

ERROR

ELSE

CALL listen(sock,5)

...

END IF

...

END INITIALIZATION

SCENARIO Main

....

Related Topics

Conditions