Skip to content

LineCount Global Variable

See Also: Direct Output, Output, Write

Purpose

To return the number of lines output since the last formfeed.

Type

Integer

What It Does

LineCount is intended to keep track of the number of lines of the current output page which have been used as program outputs through the output and writeln commands. Every time an image is output, the number of lines in that image is added to LineCount. Every time a writeln command is executed, LineCount is incremented by one. Every time a formfeed command is executed, a new page is considered to have been started, and LineCount is zeroed.

Move 0 To LineCount
Writeln "Line One"
Writeln "Line Two"
Showln LineCount
Writeln "Line three"
Showln LineCount

In this example, the first Showln command would display the number 2, since it occurs after two lines are written to the sequential I/O channel. The second Showln will display 3.

The report class uses LineCount to calculate the number of lines remaining unused on the current page so that it can start a new page when the current page has insufficient space remaining to accommodate the next output image.

Notes

  • LineCount counts lines output to a file when a file is named in the direct_output command, but it does not count output done through the show or showln commands.
  • LineCount is maintained in a separate value for each input/output channel in use in the program.