2016-03-18 11:36:04 +00:00
|
|
|
{{DISPLAYTITLE:_FILEEXISTS}}
|
2017-10-10 14:55:21 +00:00
|
|
|
The '''_FILEEXISTS''' function determines if a designated file name exists and returns true (-1) or false (0).
|
2015-08-02 12:12:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
{{PageSyntax}}
|
2017-10-10 14:55:21 +00:00
|
|
|
: {{Parameter|theFileExists%}} = [[_FILEEXISTS]]({{Parameter|filename$}})
|
2015-08-02 12:12:44 +00:00
|
|
|
|
|
|
|
|
2017-10-10 14:55:21 +00:00
|
|
|
{{PageDescription}}
|
|
|
|
* The {{Parameter|filename$}} parameter can be a literal or variable [[STRING|string]] value that can include a path.
|
2015-08-02 12:12:44 +00:00
|
|
|
* 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.
|
2016-03-18 11:36:04 +00:00
|
|
|
* The function will use the appropriate Operating System path separators. [[_OS$]] can determine the operating system.
|
2017-10-10 14:55:21 +00:00
|
|
|
* '''This function does not guarantee that a file can be accessed or opened, just that it exists.'''
|
|
|
|
|
2015-08-02 12:12:44 +00:00
|
|
|
|
2017-10-10 14:55:21 +00:00
|
|
|
{{PageExamples}}
|
|
|
|
{{Parameter|Example:'' Checks if a file exists before opening it.
|
|
|
|
{{CodeStart}}
|
2019-04-15 01:15:33 +00:00
|
|
|
{{Cl|IF}} {{Cl|_FILEEXISTS}}("mysettings.ini") THEN
|
|
|
|
{{Cl|PRINT}} "Settings file found."
|
2017-10-10 14:55:21 +00:00
|
|
|
{{Cl|END IF}}
|
|
|
|
{{CodeEnd}}}}
|
2015-08-02 12:12:44 +00:00
|
|
|
|
2017-10-10 14:55:21 +00:00
|
|
|
|
|
|
|
{{PageSeeAlso}}
|
2016-03-18 11:36:04 +00:00
|
|
|
* [[_DIREXISTS]], [[_OS$]]
|
|
|
|
* [[SHELL]], [[FILES]]
|
|
|
|
* [[KILL]]
|
|
|
|
|
2015-08-02 12:12:44 +00:00
|
|
|
|
2019-04-15 01:15:33 +00:00
|
|
|
{{PageNavigation}}
|