HP Pascal/iX Programmer's Guide (31502-90023)

3- 16
Table 3-6. Characteristics of Textfile I/O Procedures
------------------------------------------------------------------------------------------------
| || ||||
| Procedure | readln1 | writeln2 | page | overprint | prompt |
| || ||||
------------------------------------------------------------------------------------------------
||| |
| State that | Read-only | Write-only |
| file must be | | |
|in | | |
||| |
------------------------------------------------------------------------------------------------
| |||||||
| Writes or | Value of | Specified | End-of-line | Page-eject | Line-feed | Buffer |
| Reads | current | expression | marker | character 3 | suppression | |
| | component | | | | character4 | |
| |||||||
------------------------------------------------------------------------------------------------
| |||| ||
| To/after | To specified | To current | After | After current component | To output |
| | variable | component | current | | device |
| | | | component | | |
| |||| ||
------------------------------------------------------------------------------------------------
| || ||||
| Advances | To beginning | To beginning of next | To next | To beginning | No |
| current | of next line | line | component | of same line | |
| position | | ||||
| index | | | | | |
| || ||||
------------------------------------------------------------------------------------------------
||| |
| After call, | No | Yes |
| buffer is | | |
| undefined | | |
||| |
------------------------------------------------------------------------------------------------
1. readln and read perform implicit data conversion if the specified
variable is of any simple type other than
char
(see the
HP
Pascal/iX Reference Manual
or the
HP Pascal/HP-UX Reference Manual
for details).
2. writeln and write format the specified variable (see the
HP
Pascal/iX Reference Manual
or the
HP Pascal/HP-UX Reference Manual
for details).
3. The page-eject character causes devices to skip to the top of the
next page when it prints the textfile.
4. The line-feed suppression character prevents the device from
moving to the next line after it prints the parameter of
overprint
; thus the sequence
overprint('ABC');
writeln('XYZ');''
prints ABC and then prints XYZ on top of it.
The file-opening procedures rewrite and append and the textfile output
procedures writeln, page, overprint, and prompt leave the buffer
undefined.
Example 1
PROGRAM prog (in,out);
VAR
in,out : text;
w,x,y,z : char;
BEGIN
reset(in); {Open in for textfile input}