forked from QB64-Phoenix-Edition/QB64pe
-
Notifications
You must be signed in to change notification settings - Fork 0
_FILEEXISTS
Samuel Gomes edited this page Nov 8, 2022
·
1 revision
The _FILEEXISTS function determines if a designated file name exists and returns true (-1) or false (0).
theFileExists% = _FILEEXISTS(filename$)
- The filename$ parameter can be a literal or variable STRING value that can include a path.
- The function returns -1 when a file exists and 0 when it does not.
- The function reads the system information directly without using a SHELL procedure.
- The function will use the appropriate Operating System path separators. _OS$ can determine the operating system.
- This function does not guarantee that a file can be accessed or opened, just that it exists.
Checks if a file exists before opening it.
IF _FILEEXISTS("mysettings.ini") THEN
PRINT "Settings file found."
END IF