#### Sample Code for File Delete

The sample code below should be entered inside the Edit window's Command Mode, not inside the File I/O dialog box.

The following code asks for a file name and then deletes the file.

C1=COMMENT/INPUT,Please type a file you want to delete.

,(Include full file path)

V1=FILE/EXISTS,C1.INPUT

IF/V1<>0

COMMENT/OPER,File exists. Ready to delete.

FILE/DELETE,C1.INPUT

V2=FILE/EXISTS,

IF/V2==0

COMMENT/OPER,File deleted successfully

PROGRAM/END

END_IF/

ELSE/

COMMENT/OPER,File still exists

PROGRAM/END

END_ELSE/

END_IF/

COMMENT/OPER,File doesn't exist to delete. Choose a file that exists.

Code Explanation

Much of this code is similar to that explained in "Sample Code for File Move ".

Only explanations unique to this example are given here.

FILE/DELETE,C1.INPUT
This line deletes the file specified. This command takes one parameter, the name of the file to delete. In this case, C1.INPUT.