The FOR statement is similar to DO, but is specifically for iterating through records. The FOR statement starts an iterating block that reads a record from one or more tables at the start of each block iteration. The END statement terminates the FOR block.

Syntax

FOR ... :
  /* ABL statements */
END.

The following example uses a FOR EACH block to iterate through the records in the Customer table:

/* Display customers with a balance under $1000 */

FOR EACH Customer WHERE Customer.Balance < 1000:
  DISPLAY Customer.Name.
END.

For more information, see FOR EACH CUSTOMER in Develop ABL Applications.