EXIST function

Purpose: EXIST returns 1 if the filename, folder or UNC path exists.


 Syntax:

 RetVal% = EXIST(FileName$)

 Parameters:

  • RetVal% Returned integer containing 1 if the FileName$ exists and containing 0 if it does not exist.
  • FileName$ String literal or variable containing file, folder or UNC path name. A UNC(Universal Naming Convention) path uses the following syntax:

    \\ServerName\Share

    where ServerName is the name of the network server and Share is a folder on the server. [NOTE WELL] UNC PATHS may not contain the wildcard chars * or ?

Examples :


 IF EXIST(Filename$) THEN ...

 IF NOT EXIST(Filename$) THEN ...

 PRINT EXIST("\\server\share\file.txt")

BCX Console Sample Programs using EXIST function.

S44.bas   S71.bas