ProvideX V8.20 > Language Reference > 2. Directives
119
ERASE Directive
           Delete File/Directory from System
Format
ERASE name$[,ERR=stmtref]
Where:.
name$
Name of file or directory to be deleted from the system. String
expression. To erase a file from a program library, use [LIB], p.777.
stmtref
Program line number or label to transfer control to.
Restrictions: A directory can only be deleted if it does not contain any files. ProvideX
is subject to OS rules for the deletion of files or directories. In some operating systems,
the ERASE directive is not accepted and will not delete the directory.
Description
Use the ERASE directive to delete the file or directory you name. The disk space that
was used by the file or directory is returned to the system. If you erase a file, all data
in the file is lost.
WindX supports the use of this directive via the [WDX] tag; e.g., ERASE
"[WDX]somefile.ext"... For more information, see [WDX] Direct Action to
Client Machine, p.797.
Note: This directive does not apply to any file segments for a multi-segmented file.
See Also
Creating, Deleting, and Renaming Data Files, User's Guide.
Examples
0010 ERASE "PRNTFL"
0030 ERASE "SRTFL1",ERR=0040