Modula-2 || Compiler & Tools || Library || Search Engine


Ulm's Modula-2 Library:
OutLines


NAME

OutLines - pagewise output

SYNOPSIS

VAR MaxLines : INTEGER;


PROCEDURE SetFile(file : FILE); PROCEDURE SetLong(long : Long);

PROCEDURE DefineLine(relatively: BOOLEAN; line : INTEGER) : BOOLEAN;

PROCEDURE OutAll() : BOOLEAN; PROCEDURE OutNext() : BOOLEAN; PROCEDURE OutPrev() : BOOLEAN; PROCEDURE OutRange (begin, end : INTEGER) : BOOLEAN;

DESCRIPTION

OutLines allows a pagewise output of text stored in a dynamic string of type Long (imported from LongStrings).

SetFile defines a new out stream file (default StdIO.stdout), SetLong defines a new output source long (no default) and marks 0 as the current line.

OutNext outputs the next at most MaxLines lines (default 23) found in long to stream file. The last output line becomes the new current line.

OutPrev outputs at most MaxLines preceding the current line. The first output line becomes the new current line.

DefineLine defines a new current line. If relatively is TRUE the old value is incremented by line else the current line is set to line (absolutely). An absolute line number may specified as 0 or -1 to mark positions before or beyond any other line.

OutAll outputs long completely and sets the current line to -1 (beyond any other).

OutRange outputs the range defined by [from,to] without affecting the current line.

Each redefinition of MaxLines and any update of the contents behind long requires a reinitialization of output by SetLong.

The output produced by this modules will be echoed to further files after suitable calls of LongStrings.Echo.

DIAGNOSTICS

Output routines return FALSE if output is exhausted, if the requested lines are not available or if writing to file fails.

SEE ALSO

LongStrings, L, StdIO

BUGS

Output will fail, if the last character of long is not a newline (12C).

Unpredictable effects may occur if the contents of long has been updated without a following reinitialization of output by SetLong.

AUTHOR

Werner Stanglow
Edited by: borchert, last change: 1997/02/25, revision: 1.2, converted to HTML: 1997/04/28

Modula-2 || Compiler & Tools || Library || Search Engine