EXISTS (return file or folder existence)

Top  Previous  Next

 

EXISTS( file )

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:\Clarion8\BIN\') !Is there a Clarion 8 BIN folder

  DO InstallCheck

 END

 

See Also:

OPEN

STATUS

CREATE

NAME