User Tools

Site Tools


exists_return_file_existence_.htm
Navigation:  Language Reference > 13 - Built-in Functions >====== EXISTS (return file or folder existence) ====== Previous pageReturn to chapter overviewNext page

EXISTS( file )

blk2blue.jpg

EXISTS Returns TRUE if the file is available on disk.
file An expression containing the DOS filename.

The EXISTS procedure returns true (1) if the file is available on disk. If the file is not available, EXISTS returns false (0). You can also use EXISTS to check for the existence of any folder.

Return Data Type: LONG

Example:

SomeFile  CSTRING(FILE:MaxFilePath),STATIC

Customer  FILE,DRIVER('ASCII','/CLIP = on'),CREATE,NAME(SomeFile)

Record     RECORD

_Line       STRING(1024)

          END

         END

 CODE

SomeFile = 'customer.tps'

IF EXISTS(SomeFile) !or EXISTS(NAME(Customer)) is also valid

  OPEN(Customer)

ELSE

  CREATE(Customer)

END

 

 IF EXISTS('C:\Clarion\BIN\') !Is there a Clarion BIN folder

  DO InstallCheck

 END

See Also:

OPEN

STATUS

CREATE

NAME

exists_return_file_existence_.htm.txt · Last modified: 2021/04/15 15:57 (external edit)