MyChat Scripts Engine: FolderExists
Function to check if the folder exists.
Syntax
function FolderExists(const sFolderName:string): boolean;
Parameters and return values
Parameter |
Type |
Value |
sFolderName |
string |
full path to the folder that you need to check for its existence. |
Function result
"True" if a folder exists, "false" if not.
Example
const
FOLDER_NAME = 'c:\temp\logs\today reports\';
begin
mLogScript('Checking folder "' + FOLDER_NAME + '"...', '');
if FolderExists(FOLDER_NAME) then mLogScript('Exists!', '')
else mLogScript('Not exists', '');
end.
Script work result
[19:20:16] (Log "FolderExists"): Checking folder "c:\temp\logs\today reports\"...
[19:20:16] (Log "FolderExists"): Not exists
[19:20:16] (Run "FolderExists"): Operation time: 8 ms
[19:20:16] (Run "FolderExists"): Script done successfully.