Append - procedure

Opens an existing text file in append mode (the file pointer is set at the end of the file).


Append (var F: text)

F is a text file variable that must be associated with an existing disk set (using the Assign procedure).

The procedure opens an existing disk file with the name associated with F. If the corresponding file does not exist, an error occurs. If F is already open then it will be closed first and then open again. The set index is set at the end of the open set. The F file is a write-only file. If the last end of the block contains the end-of-file character (Ctrl-Z; ASCII-26), the set index is set at the first occurrence of the end-of-file character in this block. In this case, the new text will be appended to the file with the Ctrl-Z character. If F is associated with the empty name (Assign (F, '')) then after calling the procedure Append F will be associated with the standard output device. If the input/output control option {$I+} is enabled during compilation (default enabled, can be turned off by {$I-}), the IOResult function will return 0 when the operation was successful or the corresponding error code when the error occurred.