Delete(FileName: String);
FileName — a path and name of the file that should be deleted.
The Delete method deletes a file, passed by the parameter FileName. If there is an attempt to delete nonexistent file, an error message is generated.
Sub Main;
Begin
If File.Exists("c:\New_folder\1.txt") Then
File.Delete("c:\New_folder\1.txt");
End If;
End Sub Main;
After executing this example,, file 1.txt is deleted if it exists.
See also: