Delete(FileName: String);
FileName — path and name of the file that must be deleted.
The Delete method deletes a file passed by the FileName parameter. If there is an attempt to delete non-existing 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 the example, the 1.txt file is deleted if it exists.
See also: