Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Turbo Pascal - <b> erase erase a disk file pp 96</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 ERASE                        Erase a Disk File                        pp 96

 Syntax:  Erase (FileVar) ;

 Type:    File

 Form:    Procedure

 Purpose: Erase disk file associated with FileVar.

 Notes:   It is good practice to Close a file before calling Erase.


 ----------------------------------------------------------------------------


 Usage:
       TYPE
          FileType = String [80]      ;   { Define record size         }
       VAR
          FileVar  : File of FileType ;   { Define the handle          }

       BEGIN
          Assign (FileVar,'Test.Dat') ;   { Assign filename to FileVar }
          Reset  (FileVar)            ;   { Open the file              }
          Close  (FileVar)            ;   { Close the file             }
          Erase  (FileVar)        ;   { Erase the file             }
       END.

See Also: Assign Close Reset ReWrite

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson