Trash Method (RUNTIME)
The Trash method allows a directory or file to be deleted and moved to the Windows Recycle Bin. This method is only implemented for the Windows. The method uses the following format:
|
|
|
|
|
|
|
|
|
|
|
|
Where:
Optional. A Program Execution Label.
Required. A RUNTIME object.
Optional. A Numeric Variable that returns any error number generated.
Required. A Character String Variable or literal that contains the Windows directory. The path must be a valid Windows directory and wildcard characters are not allowed in the path string.
Optional. A Character String Variable or literal that contains an optional filename. If a filename is specified, Windows wildcard characters are allowed.
Optional. A Numeric variable or decimal number that invokes special behaviors for the method.
Flags Affected: EOS, OVER, ZERO
Note the following:
The EOS flag is always cleared.
The ZERO flag is set TRUE if the {return} value is zero. Otherwise, the ZERO flag is set to FALSE.
The OVER flag is set if the {return} variable is too small to receive the value without being truncated.
The path parameter is always required. If the filename parameter is not specified or is NULL, the Trash method deletes the specified directory which is moved to the Windows recycle bin. The path parameter must be an existing directory and no Windows wildcard characters are allowed. Otherwise, the method gives an error.
The {options} parameter is available for future use.
If the {path} drive being used refers to a SUBST'd drive or a network shared drive, this method does not move a deleted file/directory to the Windows recycle bin. This behavior is controlled by the Windows operations.
If the Trash method fails, the returned error values are described as follows:
|
Value |
Description |
|
-1 |
The path does not exist. |
|
-2 |
The wildcard characters ( * and ? ) are not allowed. |
|
nnn |
The 'nnnn' error values are the Windows Error code values except described as follows: 116 (0x74) The source is a root directory, which cannot be moved or renamed.
120 (0x78) Security settings denied access to the source.
121 (0x79 ) The source or destination path exceeded or would exceed MAX_PATH. |
See Also: RUNTIME, Method Syntax
![]() |