Progress
Language Reference
LINE-COUNTER Function
Returns the current line number of paged output.
The initial value of LINE-COUNTER is 1. At the completion of each DISPLAY statement, Progress increments LINE-COUNTER by the number of lines that were output in that DISPLAY statement. LINE-COUNTER continues to increase until after at least one line has been printed on a new page.
Line-COUNTER returns a 0 if the output is not paged.
SYNTAX
stream
Specifies the name of a stream. If you do not name a stream, Progress uses the unnamed stream. For more information on streams, see this book’s DEFINE STREAM Statement reference entry and the Progress Programming Handbook chapter on alternate I/O sources.
EXAMPLEThis procedure prints a customer report, categorized by state. At the end of each state category, it tests to see if there are at least four lines left on the page. The LINE-COUNTER function returns the current line number of output. If that number plus four is greater than the total number of lines on the page (returned by the PAGE-SIZE function), then the procedure starts the new page. If there are four or more lines left, the procedure skips a line before printing the next customer record.
NOTES
- When output is sent to a device other than the terminal screen, Progress defers displaying a frame until another frame is displayed. That way, if you display the same frame several times consecutively, Progress performs all those displays at once. Because of this optimization, if the last display fills the page, the value returned by the LINE-COUNTER function can be larger than the page size, even though the next frame is displayed at the start of the new page.
- Use the a procedure like this one to verify that output is positioned on the first non-header line of a new page.
SEE ALSO
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |