Hi,
>Does anybody know how I can check programmatically if a file exists in a certain location. I have a path and file stored to a variable and i want to check if it exists. For example:
>
>C:\program files\pictures\dress.tif
>
>If this file exists in this location I want to issue a messagebox command.
>
>Any help would be greatly appreciated.
Use FOPEN, the following example is from the help section
IF FILE('errors.txt') && Does file exist?
gnErrFile = FOPEN('errors.txt',12) && If so, open read/write
ELSE
gnErrFile = FCREATE('errors.txt') && If not, create it
ENDIF
IF gnErrFile < 0 && Check for error opening file
WAIT 'Cannot open or create output file' WINDOW NOWAIT
ELSE && If no error, write to file
=FWRITE(gnErrFile, 'Error information to be written here')
ENDIF
=FCLOSE(gnErrFile) && Close file
MODIFY FILE errors.txt NOWAIT && Open file in edit window
Regards N Mc Donald