Equinox Online Help - Language Reference - A to Z

Home

ChooseFile

Applies to
SyntaxChooseFile FileExpression, PathItem, RemoteExpression, [, NewFiles]
Action[Statement] Allows you to select a file name, using a file dialog.
ScopeUsable anywhere.
Notes

This statement displays a file dialog on screen. You can use the dialog to navigate through directories and select a file. There are three arguments: FileExpression, PathItem and RemoteExpression.

FileExpression is a string value and determines the initial directory and file name extension. eg If you wanted to display all the form definition files for an employees database, you could use the following value for FileExpression:

"C:\EQUINOX\MYAPP\PARAMS\EMPLOYEES\*.FRM"

If you want, you can supply FileExpression as just "*.*" and Equinox will revert to the default, displaying all files in the Equinox directory.

PathItem is a field, variable, or workarea name. When the user has highlighted a file and chooses the OK button on the dialog, the selected file name (including path) is returned in PathItem.

If RemoteExpression evaluates to True then the file dialog will be targeted at the server, allowing you to select a file from the server drive(s). If RemoteExpression is False then the file dialog will allow you to select a file from the local drive(s).

If omitted, RemoteExpression defaults to True.

In the single-user version of Equinox, RemoteExpression is ignored and only local drives are included.

NewFiles can be used to let the user specify files that don't yet exist on the local drive only. Valid values are:

  • 0 Don't allow user to create new file (default)
  • 1 Allow new file, as well as existing, via New button (prompt for overwrite if necessary)
  • 2 Allow only new filenames

If a file is chosen, the system workarea SysReply is set to one. Otherwise it is set to zero.

CategoryFile Management
See Also FileDelete, FileDetails, FileExists, FileHandle, FilePath, FileRename, FileSearch, FileSearchNext, MakeDirectory, RemoveDirectory
Example

The following example executes a form chosen by the user.

String filename

ChooseFile "*.FRM", filename
If SysReply Then Execute Form filename