Release 10.1A: OpenEdge Development:
Programming Interfaces

> ## Control blocks and output statements

> Compiling a report usually involves a straightforward process of moving through a set of table records, calculating data, and outputting results. A control block best handles the report-generating process. Most reports use the `FOR EACH` block because of its record-reading properties. Here is an example:

>     FOR EACH Customer FIELDS (Name) WITH FRAME Frame1:
>       IF BALANCE > 0 THEN Bal-due = YES.
>         ELSE Bal-due = NO.
>       DISPLAY Name Bal-due.
>     END.

> The default frame of an iterating control block is a down frame.

> The `DISPLAY` statement is Progress’s main programming statement for output. `DISPLAY` can output to printers and media as well as the screen. Later, you’ll learn about another output statement and how to direct output.

Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095