Previous Icon 3

Next Icon 3

FOR loop

In KISSsoft you can also use FOR loops in the report generator. Within a FOR loop a numerical variable will be incremented (or decremented). You can use constructs that are nested down to 10 levels.

This loop is specified as follows:

FOR varname=%i TO %i BY %i DO {startwert}{endwert} {schritt}
// access variable with #varname or $varname
...
END FOR;

 

EXAMPLE OF A SIMPLE LOOP

FOR i=0 TO 10 BY 1 DO
    Run number #i $i
END FOR;

Results in the following output:

Run number 0 A
Run number 1 B
Run number 2 C
Run number 3 D
Run number 4 E
Run number 5 F
Run number 6 G
Run number 7 H
Run number 8 I
Run number 9 j
Run number 10 K

The numerical variable can be used anywhere within the loop, even for arrays.