EXIST function

Purpose:

EXIST can determine the existence of a filename, directory or UNC (Universal Naming Convention) path.

Syntax:

RetVal = EXIST(FileName AS STRING)

Return Value:

  • Data type: BOOL
    RetVal If FileName exists, 1, otherwise 0.

Parameters:

  • Data type: STRING
    FileName A file, directory or UNC path name.

Remarks:

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 directory on the server.

👉 UNC PATHS may not contain the wildcard asterisk or question mark characters.

Example:

IF EXIST(Filename$) THEN ...

IF NOT EXIST(Filename$) THEN ...

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

BCX Console Sample Programs using the EXIST function.