Please enable JavaScript to view this site.

R:BASE 11 Help

Navigation: Function Index > C

CHKFILE

Scroll Prev Top Next More

(CHKFILE('filespec'))

 

Checks to see if a file or folder name exists. If no path is specified, the function checks for the file or folder name in the current directory. Otherwise, the function checks for the file or folder name in the specified location. When checking the existence of a folder name, omit the backslash character at the (\).

 

The function returns a 1 if the file or folder name is found, and 0 if it is not found. Wild cards in the filename will produce unpredictable results.

 

Examples:

 

-- Checks for the D:\RBASE\Data folder

SET VAR vFolderCheck INTEGER = (CHKFILE('D:\RBASE\Data'))

 

-- Checks for the CustomerKeys.csv file

SET VAR vFileCheck INTEGER = (CHKFILE('CustomerKeys.csv'))