delete( )
Topic group Related topics Example
Removes a file from a disk, optionally sending it to the Recycle Bin.
Syntax
<oRef>.delete(<filename expC> [, <recycle expL>])
<oRef>
A reference to a File object.
<filename expC>
Identifies the file to remove. <filename expC> may be a filename skeleton with wildcard characters. In that case, dBASE Plus displays a dialog box in which you select the file to duplicate.
If you specify a file without including its path, dBASE Plus looks for the file in the current directory, then in the search path(s) you specified with SET PATH, if any. If you specify a file without including its extension, dBASE Plus assumes no extension. If the named file cannot be found, an exception occurs.
<recycle expL>
Whether to send the file to the Recycle Bin instead of deleting it. If omitted, the file is deleted.
Property of
File
Description
delete( ) deletes a file from a disk, or sends it to the Recycle Bin.
If <recycle expL> is true, then SET SAFETY determines whether a dialog appears to confirm sending the file to the Recycle Bin. If <recycle expL> is false or omitted, SET SAFETY has no effect on delete( ); the file is deleted without warning.
delete( ) does not automatically remove the auxiliary files associated with table files, such as indexes and memo files. For example, it does not delete the MDX or DBT files associated with a DBF file. When deleting tables, use the Database object’s dropTable( ) method.
You cannot delete( ) a file that is open, including one opened with the open( ) or create( ) methods; it must be closed first.