Top > Lycia reference > Querix 4GL > Statements > FOR
To meet your needs, we constantly work to improve Querix products.
This means that Lycia documentation is developing as well.
In case you have found a certain dissonance between the provided information and the actual behavior of Lycia 3 and/or your applications, please, let us know about this via documentation@querix.com so that we can introduce the necessary changes to our documentation.
Thank you for your attention and cooperation.
FOR statement specifies a loop, the statements within this loop are executed a definite number of times.
Element |
Description |
Counter |
A variable of INTEGER or SMALLINT data type that serves as an index for the statement block. |
TO Clause |
A clause where the upper and lower limits for the counter are specified |
STEP Clause |
An optional clause specifying the size of one step |
Logical Block |
A block that must include at least one executable statement. It can also include the definition block |
The statements in the Logical Block are executed the specified number of times, unless the execution of the FOR statement is terminated by the EXIT FOR statement. The FOR statement is typically used, when you know the upper limit of the iterations required. If you are not sure how many times the loop is to be repeated, it is advisable that you use the WHILE loop instead.