FileExists (Confirm file existence)

Top  Previous  Next

 

FILEEXISTS( filename )

FILEEXISTS

Confirm the existence of a file

filename

A string constant or variable containing the name of the file (and path, if applicable)

FILEEXISTS confirms the existence of a file. If FILEEXISTS returns TRUE (1), the file exists. If FILEEXISTS returns FALSE (0), the file specified in the filename parameter does not exist.

To add support for this utility to your existing applications, you need only include the CWUTIL.INC file in the Global Map section of your program:

INCLUDE('CWUTIL.INC'),ONCE

Return Data Type: BYTE

Example:

IF NOT FILEEXISTS(GLO:NewFile)              !If the file does not exist

DO CreateFile                              !Call the ROUTINE to create it

END

 

IF NOT FILEEXISTS('C:\INVOICE\Config.dat')  !Does the config file exists

InitConfig                                 !Call init procedure

END