Futurebasic/Language/Reference/filesstr fopen

Function
✔ Appearance ✔ Standard ✔ Console

Revised
February, 2002 (Release 6)

Description
This function prompts the user to select an existing file. It does this by displaying the standard "Get File" dialog shown below (its appearance may be different on some systems). If the user selects a file, then the file's name is returned in, and a reference number for the file's directory is returned in   (which must be a short integer variable). If the selected file is in a volume's root directory, the will return a volume reference number; otherwise, it will return a working directory reference number. If the user cancels the dialog, then the function returns an empty (zero-length) string, and it sets  to zero.

If the global variable  is non-zero, FB switches to the more modern Navigation Services dialog. If the one of the FSSpec version of the call is used,  is assumed to be.

You can limit the types of files that appear in the dialog by specifying up to four file types in. For example, is you pass the string " " in, then only files of type " " and type " " will be available for selection. If  is an empty string, or the parameter is omitted, then all file types will be available for selection.

Image was here

If you use the optional  (or   ) parameter, the standard files dialog may display a preview of the file currently selected.

Image was here.

Note: The ...  function does not actually open the selected file. Use the  statement if you need to open the file.

The reference number returned in  is a temporary number, which is only valid until your program quits. You cannot use this same number to refer to this folder at a later date. If you need to keep track of a file's location over time, create and save an alias record for the file.