[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.6 STD:For

The STD:For module provides for loop (also known as do loop) control. A loop is a block of code (here, the modules that are children of the STD:For module) that is repeatedly executed until some condition signals the end of the loop.

The Index Variable field is the name of the variable that keeps track of the loop. By default, Index Variable is `i'. Some common names (here, `j', `k', etc) are provided for quick access in the combobox, but any valid variable name may be used (this is true for all the list values in the STD:For comboboxes).

The Start Value is the value that the index variable is set to at the start of the loop. Most frequently, this will be one (which is the default). However, any valid value (constant, variable or array reference, expression) may be used.

The Increment is the value that is added to the index variable at the end of each iteration. Like the start value, its default value is one, but can be anything. Note that counting down is done by entering a negative value.

The loop exit condition specifies when the loop terminates. The condition may be specified in one of two ways. The simplest is to set the Index Equals radiobutton and enter a value. The loop will continue while the index variable is less than or equal to (in the case of a negative increment, greater than or equal to) this value.

For more complex control, the Expression radiobutton may be selected and any valid Bunao expression entered beside it. The loop continues while the expression is true (non-zero or non-null).

STD:For user interface:

images/std-for

STD:For attribute list:
Attribute Type Default Description
index variable `i' index (control) variable
startval value `1' initial value of control variable
increment value `i' added to control at end of each iteration
cexprtype simple
complex
`simple' loop condition type: simple or complex
tclexpr value (blank) expression for complex loop condition
end value (blank) expression for simple loop condition


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated on October, 28 2005 using texi2html