TURBO Pascal 3.0 projects



The missing procedure APPEND
(TURBO PASCAL 3.x for CP/M 80)

There are three procedures available for initializing files running TURBO PASCAL 3.0:
1 RESET(FILE) Open an existing file for reading
2 REWRITE(FILE) Open an existing or new file for writing
3 APPEND(FILE) Open an existing file for writing
However the procedure APPEND(FILE) is valid for the MS-DOS version of TURBO PASCAL only. I don't know why it is not available for the CP/M version. From my point of view it is an easy task to implement the procedure for CP/M.
Find a short description of the procedure which must be called the following way:

APPEND(TEXT_File);

The file TEXT_file of type TEXT must not be opened. If the file is not found, the value 01 will be stored into variable IORESULT.
(See I/O error messages in the manual)
If the file is empty, a value of 02 will be stored. So it is the responsibility of the programmer handling error results.

Find available here the sources of the procedure Append written in Z80 assembler, the inline code to be inserted into a program by {$i append.inl } for example and a simple TURBO PASCAL program testing the procedure:


Published in Klubzeitung No. 56    Author: Werner Cirsovius