DELETESEQ Statement
Deletes the specified host file. There is no need to open the file first with the OPENSEQ statement.
This version of the DELETESEQ statement is provided for compatibility with mvEnterprise. It is only available in MVENTERPRISE mode (set with the $OPTIONS statement).
Syntax
DELETESEQ path,filename {SETTING setting-var} {ON ERROR statement(s)} {LOCKED statement(s)} [ THEN statement(s) | ELSE statement(s) ]
Syntax Elements
path An expression that evaluates to the path of the directory containing host file to delete.
filename An expression that evaluates to the filename of the host file to delete.
setting-varThe name of a variable to which the return status is assigned. See Operation for details of the possible values for this variable.
statement(s)A sequence of one or more valid DataBasic statements, either separated by semicolons, or contained on separate lines and followed by an END statement.
Operation
The following details circumstances under which the different clauses are executed and the values returned in setting-var:
Clause Executed |
Reason |
setting-var |
STATUS() Value |
---|---|---|---|
THEN |
File successfully deleted |
0 |
0 |
LOCKED |
File locked by another user. |
Lock owner's port number |
Lock owner's port number. |
ON ERROR |
File does not exist |
2040 |
206 |
|
Invalid path or filename |
2416 |
204 |
|
General file error |
Error number |
Error number |
Note
-
If an error occurs but there is no ON ERROR clause, the DataBasic Debugger will be entered with error B53 as well as the setting-var value.
-
The final column gives the values returned by the STATUS function if this is used instead of a SETTING clause.
-
The ELSE clause is never executed.
Comments
If the file is locked by another user, the LOCKED clause is executed if present. Otherwise, the DELETESEQ statement is suspended until the file becomes unlocked.
If the deleted file was open, the lock taken by the OPENSEQ statement is retained.