Displays the system’s Save File dialog box with the specified file name displayed in the File name box. The user can enter a file name or select a file from the grayed list.
GetFileSaveName ( title, pathname, filename {, extension {, filter { , initdir { , aFlag } } } } )
GetFileSaveName ( title, pathname, filename [ ] {, extension {, filter { , initdir { , aFlag } } } } )
Argument |
Description |
---|---|
title |
A string whose value is the title of the dialog box. |
pathname |
A string variable whose value is the default file name and which stores the returned path and file name. On a handheld device, the pathname value must be the My Documents directory or one of its subdirectories. The default file name is displayed in the File name box; the user can specify another name. |
filename, filename[ ] |
A string variable in which the returned file name is stored or an array of string variables in which multiple selected file names are stored. Specifying an array of string variables enables multiple selection in the dialog box. |
extension (optional) |
A string whose value is a 1- to 3-character default file extension. The default is no extension. |
filter (optional) |
A string whose value is the description of the displayed files and the file extension that you want use to select the displayed files (the filter). The format for filter is: description,*. ext The default is: |
initdir (optional) |
A string whose value is the initial directory name. The default is the current directory. |
aFlag (optional) |
An unsigned long whose value determines which options are enabled in the dialog box. The value of each option’s flag is calculated as 2 to the power of (index -1), where index is the integer associated with the option. The value of the aggregate flag passed to GetOpenFileName is the sum of the individual option flags. See the table in the Usage section for GetOpenFileName for a list of options, the index associated with each option, and the option’s meaning. |
Integer. Returns 1 if it succeeds, 0 if the user clicks the Cancel button or Windows cancels the display, and -1 if an error occurs. If any argument’s value is null, GetFileSaveName returns null.
If you specify a DOS-style extension and the user enters a file name with no extension, PocketBuilder appends the default extension to the file name. If you specify a file mask to act as a filter, PocketBuilder displays only files that match the mask.
For usage notes on the filter, initdir, and aFlag arguments, see the GetFileOpenName function.
These statements display the Select File dialog box. The default file extension is .DOC and the filter is all files. If a file is selected successfully, its path displays in a SingleLineEdit control:
string ls_path, ls_file int li_rc ls_path = sle_1.Text li_rc = GetFileSaveName ( "Select File", & ls_path, ls_file, "DOC", & "All Files (*.*),*.*") IF li_rc = 1 Then sle_1.Text = ls_path + "\" + ls_file End If