Difference between revisions of "Page"

From Free Pascal wiki
Jump to navigationJump to search
(update)
(categorize page, insert links in dead-end page, rewrite with structure)
 
Line 1: Line 1:
The '''page''' procedure is used to tell the system to advance to the next page on that system's output writer. This was generally different from system to system. On IBM mainframes, it meant putting a '1' (the character of the digit 1) as the first character of the output line. On most ASCII machines, it means generating a form feed character, CHR(12).
+
The [[Standard Pascal|standard]] [[Procedure|<syntaxhighlight lang="pascal" inline>procedure</syntaxhighlight>]] '''<syntaxhighlight lang="pascal" inline>page</syntaxhighlight>''' advances the output of a given textfile by one page.
 +
''Page'' could refer to a piece of paper if the destination is a physical printer, or could imply blanking the entire screen, the specific behavior is implementation-defined.
  
The page() procedure thus provided a machine-independent way to advance output to the next page.
+
== signature ==
 +
<syntaxhighlight lang="pascal" inline>Page</syntaxhighlight> takes ''one'' [[Text|<syntaxhighlight lang="pascal" inline>text</syntaxhighlight> file]] as a parameter.
 +
It determines the destination.
 +
If the destination is [[Output|<syntaxhighlight lang="pascal" inline>output</syntaxhighlight>]], it can be omitted.
 +
<syntaxhighlight lang="pascal" inline>page;</syntaxhighlight> is short for <syntaxhighlight lang="pascal" inline>page(output);</syntaxhighlight>.
  
Format:
+
== behavior ==
'''Page();''' {Older method of calling a procedure with no parameters
+
Provided the destination is open for writing:
or
+
# If not at the ''beginning'' of a line, do a [[writeln|<syntaxhighlight lang="pascal" inline>writeLn(destination)</syntaxhighlight>]].
'''page;'''
+
# Implementation-defined method of advancing to the next “page”.
  
Page will advance OUTPUT to the next page.
+
== implementation ==
 +
* On IBM mainframes, advancing to the next page was achieved by putting a <syntaxhighlight lang="text" inline>1</syntaxhighlight>, that is the character of the digit&nbsp;1, in the first column of a line.
 +
* On most machines using [[ASCII]] though, it simply means emitting a form feed character, i.&#8239;e. [[Chr|<syntaxhighlight lang="pascal" inline>chr(12)</syntaxhighlight>]]. The [[FPC]] and the [[GNU Pascal]] Compiler use this method.
 +
 
 +
== notes ==
 +
* In the FPC <syntaxhighlight lang="pascal" inline>page</syntaxhighlight> is only available in [[Mode iso|<syntaxhighlight lang="delphi" inline style="whitespace: nowrap;">{$mode ISO}</syntaxhighlight>]] and [[Mode extendedpascal|<syntaxhighlight lang="delphi" inline style="whitespace: nowrap;">{$mode extendedPascal}</syntaxhighlight>]].
 +
* <syntaxhighlight lang="pascal" inline>Page</syntaxhighlight> is a regular [[Identifier|identifier]] and as such can be redefined.
 +
 
 +
[[Category: File Handling]]
 +
[[Category: Pascal]]

Latest revision as of 04:20, 24 January 2022

The standard procedure page advances the output of a given textfile by one page. Page could refer to a piece of paper if the destination is a physical printer, or could imply blanking the entire screen, the specific behavior is implementation-defined.

signature

Page takes one text file as a parameter. It determines the destination. If the destination is output, it can be omitted. page; is short for page(output);.

behavior

Provided the destination is open for writing:

  1. If not at the beginning of a line, do a writeLn(destination).
  2. Implementation-defined method of advancing to the next “page”.

implementation

  • On IBM mainframes, advancing to the next page was achieved by putting a 1, that is the character of the digit 1, in the first column of a line.
  • On most machines using ASCII though, it simply means emitting a form feed character, i. e. chr(12). The FPC and the GNU Pascal Compiler use this method.

notes