Go to the first, previous, next, last section, table of contents.

FOR Statement

Initializes id to expr1, evaluates expr1 and expr2, then executes stmts, increments id by stepval (by 1 if stepval is not specified), and loops if id <= expr2. If stepval is negative, then loops while id >= expr2.

expr1 and expr2 must both be of the same ordinal type (see section Ordinal Types). id is defined locally by the FOR loop as a READONLY variable, and its type is the type common to expr1 and expr2.


Example


Example

Print the letters 'A'..'E' using the CHAR ordinal type for the FOR limits:


Go to the first, previous, next, last section, table of contents.