If file or folder exists

Obsolete. Use FileExists or str.searchpath.

 

Syntax

iff[-] file
(tab)statements
(tab)...
[else
(tab)statements
(tab)...]

 

Can be single line:

iff[-](file) statements
[else statements]

 

Parameters

file - file to search for. Can be file or folder. Also can be drive. Can be full path or filename.

 

Options:

- not.

 

Remarks

Similar to if.

 

If file exists, executes statements after iff and skips statements after else (if used). Else skips statements after iff and executes statements after else (if used).

 

QM 2.3.3. Can be used as function. Returns 1 if the file exists, 0 if not.

 

If file is not full path, searches in these places. Works like str.searchpath.

 

Examples

iff("c:\m\x.txt") mac- "Copy" ;;if file exists, execute macro "Copy"
iff-("notepad.exe") bee ;;if file  doesn't exist, beep
iff(s) out s ;;if file exists, show path. Path is in variable s
iff-("$My Pictures$") end ;;if special folder doesn't exist, end macro

 Can be used as function
if(iff("file1") and !iff("file2")) out "file1 exist; file2 does not exist."