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

     USE: Function to erase an external file.  The file must first be
          associated with a file variable of any type.  After a call to
          erase no further operations can be accomplished on the file
          variable. Errors are returned through IOResult and open files
          cannot be erased.

     DEPENDENCY:  None

     SYNTAX: Erase(FileVarable);

     EXAMPLE:      Program TestErase;
                   Var
                      FVar     : File;
                      FileName : String;

                   Begin
                      Write('Enter filename to erase: ');
                      Readln(FileName);
                      Assign(FVar,Filename);
                      {$I-}
                      Erase(FVar);
                      {$I+}
                      if IOResult <> 0 then
                         Writeln('Error *** File Not Erased');
                   end.

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