Libraries
More filter Source Code
 previous   up   next 

Types
moreFile
File implementation type of a more filter file.

moreFile

const type: moreFile

File implementation type of a more filter file.


Function Summary
file
openMore (in file: destFile, in file: commandFile, in integer: pageSize)
Open a more filter file for viewing a file page by page or line by line.
void
writeln (inout moreFile: outFile)
Write end-of-line to outFile.
void
write (inout moreFile: outFile, in string: stri)
Write the string stri to a moreFile.

Function Detail

openMore

const func file: openMore (in file: destFile, in file: commandFile, in integer: pageSize)

Open a more filter file for viewing a file page by page or line by line.

more := openMore(OUT, KEYBOARD, 20);
writeln(more, multiPageDocument);

After writing the requested number of lines it prompts for the next command with:

--More--

The following commands are accepted:

  • space Display the next pageSize lines.
  • return/enter Display the next line.
  • q Skip the remaining data written to the moreFile.
Parameters:
destFile - Destination file for all data written to the moreFile.
commandFile - File from which commands (' ', '\n', 'q') are read.
pageSize - Size of the page displayed after pressing the space key.
Returns:
the moreFile opened.

writeln

const proc: writeln (inout moreFile: outFile)

Write end-of-line to outFile. This function writes the end-of-line marker to the destination file. It also handles the commands allowed by a moreFile:

  • space Display the next pageSize lines.
  • return/enter Display the next line.
  • q Skip the remaining data written to the moreFile.

write

const proc: write (inout moreFile: outFile, in string: stri)

Write the string stri to a moreFile. New lines ('\n') trigger a call of the function writeln.



 previous   up   next