PreviousNextIndex

LINE-COUNTER function

Returns the current line number of paged output as an INTEGER value.

The initial value of LINE-COUNTER is 1. At the completion of each DISPLAY statement, the AVM 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

LINE-COUNTER [ ( stream | STREAM-HANDLE handle ) ] 

stream
STREAM-HANDLE handle
Example

This 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.

r-linec.p
OUTPUT TO PRINTER. 
FOR EACH Customer BREAK BY Customer.State: 
  DISPLAY Customer.CustNum Customer.Name Customer.Address Customer.City 
    Customer.State. 
  IF LAST-OF(Customer.State) THEN DO: 
    IF LINE-COUNTER + 4 > PAGE-SIZE THEN PAGE. 
    ELSE DOWN 1. 
  END. 
END. 

Notes
See also

DEFINE STREAM statement, Stream object handle


OpenEdge Release 10.2B
Copyright © 2009 Progress Software Corporation
PreviousNextIndex