IFile.Delete

Syntax

Delete(FileName: String);

Parameters

FileName — a path and name of the file that should be deleted.

Description

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.

Example

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:

IFile