Futurebasic/Language/Reference/filesstr fsave

Function
✔ Appearance ✔ Standard ✔ Console

Revised
February, 2002 (Release 6)

Description
This function prompts the user to provide a file name, and to select a folder where the file may be saved. It does this by displaying the standard "Put File" dialog shown below (its appearance may be different on some systems). If the user selects a name, then the name is returned in, and a reference number for the selected directory is returned in   (which must be a short integer variable). If the selected directory is a volume's root directory, then  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.

The string (if any) that you provide in  will appear as a one-line prompt in the dialog. The string (if any) that you provide in  will appear initially in the file name edit field in the dialog.

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.

Example: The statement:

will produce a dialog that looks something like this:

Image was here.

Note: The ...  function does not actually open or save a file. Use the statement if you need to open a file, and use output statements like   or   to save information into it.

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.