If Command

Description:

The if statement controls conditional branching. The body of an if statement is executed if the value of the expression is nonzero.

Format:

If ( condition_if )
    statements_if
[ ElseIf ( condition_elseif )
    statements_elseif ]
[ Else
    statements_else ]
Endif

Parameters:

condition_if
condition_elsif

Integer expressions.
If condition_if is non-zero, statements_if are executed.
If condition_if is zero and condition_elsif is non-zero, statements_elsif are executed.
if both condition_if and condition_elsif are zero, statements_else are executed.

Example:

if ( 1 == 2 )
    log "1 == 2";
elseif ( 1 == 3 )
    log "1 == 3";
elseif ( 4 == 4 )
    if ( 1 == 1 )
        log "1 == 1";
    else
        log "in else";
    endif
    log "4 == 4";
else
    log "in else";
endif

Output:

1 == 1
4 == 4





Go back to the Learning center:


Copyright © AgileLoad. All rights reserved.
Agile Load testing tool| Contact AgileLoad | Terms of Use | Sitemap