For Loops

The For control structure provides a simple mechanism for iteration with integer variables and takes the form:

    For <parameter>=<initial> to <final>:
        <body>
        ...

The <parameter> must be an integer parameter, i.e. declared as one of the following:

    Integer <parameter>;
    Counter <parameter>;
    Flag <parameter>;

There is no difference between these three integer parameter types incidentally, they are only included to make it clear to a human reader of a Tao script whether a particular integer variable is a counter a Boolean flag etc. It therefore makes little stylistic sense to use a Flag as the loop variable in a For statement or a Counter in an If statement.


©1999,2000 Mark Pearson m.pearson@ukonline.co.uk April 30, 2000