DELETESEQ |
![]() ![]() ![]() |
The DELETESEQ statement deletes an operating system file.
Format
DELETESEQ filename, id {ON ERROR statement(s)} {THEN statement(s)} {ELSE statement(s)} or DELETESEQ pathname {ON ERROR statement(s)} {THEN statement(s)} {ELSE statement(s)}
where
At least one of the THEN and ELSE clauses must be present.
The DELETESEQ statement deletes the operating system file identified by filename and id or by pathname. It is primarily intended as a counterpart to OPENSEQ but can be used to delete any operating system file.
The THEN clause will be executed if the action is successful.
The ELSE clause will be executed for conditions that most likely relate to user or programming errors such as the item to delete not existing or not having access rights to delete it. The STATUS() function can be used to determine the cause of the error.
The ON ERROR clause will be executed if an internal error occurs during the delete and should only be included if the program needs to continue execution rather than taking the default action of aborting at such an error. The STATUS() function can be used to determine the cause of the error.
DELETESEQ cannot be used to delete a directory.
Note that DELETESEQ takes no part in the locking system. If locking is required, the directory containing the file to be deleted must be opened as a directory type file and standard file processing statements used. |