HP Pascal/iX Programmer's Guide (31502-90023)
3-: 7
Table 3-2 summarizes the characteristics of the four predefined
file-opening procedures.
Table 3-2. Characteristics of File-Opening Procedures
------------------------------------------------------------------------------------------------
||||||
| Procedure |
Reset
|
Rewrite
|
Append
|
Open
|
||||||
------------------------------------------------------------------------------------------------
|| ||
| Type of file | Any | Any except |
| That it Can | | textfile |
| Open | ||
|| ||
------------------------------------------------------------------------------------------------
||| ||
| State in | Read-only | Write-only | Read-Write |
| Which it | | | |
| Opens File | | | |
||| ||
------------------------------------------------------------------------------------------------
|| ||
| Manner in | Sequentially | Directly |
| Which file | ||
| Can Be | ||
| Accessed | ||
|| ||
------------------------------------------------------------------------------------------------
||||||
| Purpose for | Input | Output | Output at | Input |
| Which it | | over old | end of old | and |
| Opens File | | contents | contents | output |
||||||
------------------------------------------------------------------------------------------------
||||||
| Where it Puts | First | Before | After | Before |
| Current | component | first | last | first |
| Position | | component | component | component |
| Index * | | | | |
||||||
------------------------------------------------------------------------------------------------
||| ||
| Value of
eof
|
False
|
True
|
False
|
| for File * | | | |
||| ||
------------------------------------------------------------------------------------------------
|||| |
| Erases Old | No | Yes | No |
| File Contents | | | |
|||| |
------------------------------------------------------------------------------------------------
||| |
| File Buffer | Contains | Undefined |
| Variables * | value of | |
| | first | |
| | component | |
||| |
------------------------------------------------------------------------------------------------
* For a nonempty file. For an empty file, every file-opening
procedure puts the current position index before the [nonexistent]
first component,
eof
returns
true
, and the file buffer variable is
undefined.
Associate Procedure
The predefined procedure
associate
associates a logical file with an open
physical file, and puts the current position index at the first
component.
Syntax
associate (
logical_file, file_number, open_options
)