Back to manual index

:: append()

:: Type = Filesystem function :: Environment = Windows, Linux, Unix :: What = Append opens an existing file in append mode. :: About = Opens an existing file for appending data to end of file and editing it. If the file does not exist, one is created. :: Note = Assign is not required with GibPascal as the assign can happen within the append. Example:
program filetest;

var TextOut : text;       { pointer for text file }
var FileOutput : string;  { string to write to text file}

begin

  FileOutput := 'Write this to file. ';

  append(TextOut,'testfile.txt');

  writeln(TextOut,FileOutput,FileOutput);

  closefile(TextOut);

end.
Output: Last line of text file testfile.txt will have Write this to file. Write this to file.