Contents | Prev | Next

7.4.2 The append procedure

Description

The append procedure associates a file variable with a file (i.e. opens the file variable and allows it to be used to manipulate the file). The append procedure opens the file variable in append mode. The open procedure can also be used to open file variables in append mode.

Parameters

  1. The first parameter is a reference to the file variable to be opened.
  2. The second parameter is an expression of string type or char type, and names the file variable, referenced by the first parameter, as if the built-in procedure assign had been called.
The name of the file variable, referenced by the first parmater, controls which file is opened by the append procedure. If the name is a non-empty string then a file with that name is opened. If the name is an empty string then the file opened is either the standard output file, or a temporary file (with a system generated name), depending on the project options set when the program was compiled.

File variables can get named in the following ways:

Example

   append(f, 'file.txt')   opens a file named 'file.txt'

Portability

Operating Systems: All
Standard Pascal: No

Contents | Prev | Next