next up previous contents index
Next: Exit Up: Functions and Procedures Previous: Eoln

Erase

   

Declaration:

Procedure Erase (Var F : Any file type) ;

Description:

Erase removes an unopened file from disk. The file should be assigned with Assign, but not opened with Reset or Rewrite

Errors:

A run-time error will be generated if the specified file doesn't exist.

See also:

Assign

Example
Program Example20;

{ Program to demonstrate the Erase function. }

Var F : Text;

begin
  { Create a file with a line of text in it}
  Assign (F,'test.txt');
  Rewrite (F);
  Writeln (F,'Try and find this when I''m finished !');
  close (f);
  { Now remove the file }
  Erase (f);
end.



Michael Van Canneyt
Thu Sep 10 14:02:43 CEST 1998