Please enable JavaScript to view this site.

A-Shell Reference

Added November 2014

.LINENO(channel)

.PAGENO(channel)

These return the current line # within the current page and the current page #, respectively, for sequential output files. Both counters start at 1.

These are intended to simplify traditional report coding, particularly for those working with legacy or unfamiliar report programs, by eliminating the need to keep your own line and page counts synchronized with the file contents. Note however that the counting mechanism is based on a hook that covers only the most typical cases. In particular:

For PRINT statements, the .LINENO(ch) value is only incremented by the absence of a trailing semicolon. Line feed characters which are output as data will not be counted.

PRINT #CH, PLINE                ! counts as 1 line

PRINT #CH, PLINE;               ! does not count (semicolon)

PRINT #CH, PLINE;chr(10);       ! does not count

 

Form feed characters, i.e. chr(12), will be detected anywhere, causing the .PAGENO(CH) value to be incremented, EXCEPT in the first position of the output file. The assumption there is that you are using the STRIPFF feature in the printer initialization file to ignore a leading form feed.
XCALL PRINT is supported, although the feature is probably not useful there.
XCALL PUTBYT is also supported; line and form feed will be detected anywhere.
Any other method of outputting to a sequential file will probably bypass the counter hook.

History

2014 October, A-Shell 6.1.1396:  Functions added to A-Shell