DELETESEQ

DELETESEQ

Top  Previous  Next

 

The DELETESEQ statement deletes an operating system file.

 

 

Format

 

DELETESEQ filename, id {NO.MAP} {ON ERROR statement(s)} {THEN statement(s)} {ELSE statement(s)}

or

DELETESEQ pathname {NO.MAP} {ON ERROR statement(s)} {THEN statement(s)} {ELSE statement(s)}

 

where

 

filenameevaluates to the VOC name of the directory file holding the record to be deleted.

 

idevaluates to the name of the record to be deleted.

 

pathnameevaluates to the operating system pathname of the record to be deleted.

 

statement(s)are statement(s) to be executed depending on the outcome of the DELETESEQ statement.

 

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.

 

The NO.MAP option is relevant only to directory files and suppresses the normal translation of restricted characters in record ids. See directory files for more information.

 

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.

 

 

See also:

OSDELETE