For Command

Description:

The for statement lets you repeat a statement or compound statement a specified number of times.

Format:

For variable = begin_value to end_value step step_value
    statements
Endfor

Parameters:

variable

An integer variable adjusted each time the loops execute. The adjustment is determined by the value of the step variable.

begin_value

An integer expression defining the starting value of the control variable.

end_value

An integer variable containing the terminating value of the control variable. When the control variable contains a value that is greater than this value (or lower if the step is negative), the loop terminates.

step_value

An integer variable added to the control variable each time the loop is executed.

Example:

integer i;

For i = 0 to 10 step 2
    log "i = " + ToString(i);
Endfor

Output:

i = 0
i = 2
i = 4
i = 6
i = 8
i = 10





Go back to the Learning center:


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