[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
     NAME:  Append

     USE:  Opens an existing file for appending.  Will place the file
           pointer to the end of the file.

           The file must first be prepared with the Assign command. For
           instance:

                     Assign(FileVar,'Filename.ext');

           FileVar must be of type TEXT and Filename.Ext can be any
           legitimate filename or a empty value ('') in which case
           FileVar will be assigned to the current output file.

           If FileVar was previously open, Append will first close and
           then reopen the file, setting the file position to the end of
           the file.

           The Command EOF(FileVar) will always return True.

           Errors are reported with through IOResult, with a value of 0
           returned as a successful operation.

     DEPENDENCY:  Assign must be called previous to Append.

     SYNTAX:  Append(FileVar);

     EXAMPLE:

           Program AppendTest;
           Var
             FVar : Text;

           Begin
             Assign(FVar,'TEST.DAT');
             {$I-}
             Append(FVar);
             {$I+}
             if IOResult <> 0 then ReWrite(FVar);  { if file not found
                                                     then create new one }
             Writeln(Fvar,'Appending text to TEST.DAT');
             Close(FVar);
           end.

See Also: Assign Reset ReWrite Close
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson