SaveFilename$ (function)

Syntax

SaveFilename$[([title$ [,extensions$]])]

Description

Displays a dialog box that prompts the user to select from a list of files and returns a String containing the full path of the selected file.

Comments

The SaveFilename$ function accepts the following parameters:

 

Parameter

Description

 

title$

String containing the title that appears on the dialog box's caption. If this string is omitted, then "Save As" is used.

 

extensions$

String containing the available file types. Its format depends on the platform on which the Basic Control Engine is running. If this string is omitted, then all files are used.

 

The SaveFilename$ function returns a full pathname of the file that the user selects. A zero-length string is returned if the user selects Cancel. If the file already exists, then the user is prompted to overwrite it.

e$ = "All Files:*.BMP,*.WMF;Bitmaps:*.BMP;Metafiles:*.WMF"
f$ = SaveFilename$("Save Picture",e$)

Example

This example creates a save dialog box, giving the user the ability to save to several different file types.

Sub Main()
  e$ = "All Files:*.BMP,*.WMF;Bitmaps:*.BMP;Metafiles:*.WMF"
  f$ = SaveFilename$("Save Picture",e$)
  If Not f$ = "" Then
    Msgbox "User choose to save file as: " + f$
  Else
    Msgbox "User canceled."
  End IF
End Sub

See Also

MsgBox (statement); AskBox (function); AskPassword$ (function); InputBox, InputBox$ (functions); OpenFilename$ (function); SelectBox (function); AnswerBox (function).

Note

The extensions$ parameter must be in the following format:

 description:ext[,ext][;description:ext[,ext]]...

 

Placeholder

Description

 

description

Specifies the grouping of files for the user, such as All Files.

 

ext

Specifies a valid file extension, such as *.BAT or *.?F?.

 

For example, the following are valid extensions$ specifications:

  "All Files:*"
  "Documents:*.TXT,*.DOC"
  "All Files:*;Documents:*.TXT,*.DOC"

More information

S