Maptitude GISDK Help |
Gets the name of a new file using the Windows File Open dialog box.
fnm = ChooseFileName(array file_types, string title, array options)
Argument |
Contents |
file_types |
An array of two-element arrays, with each subarray having a file type description (such as "Workspace") and a specification (such as "*.wrkz") |
title |
A title for the dialog box |
Option |
Type |
Contents |
Help |
String |
A keyword in the help system, indicating the help topic displayed if the user presses F1 |
Initial Directory |
String |
The directory first displayed by the dialog box |
Suggested Name |
String |
An inital file name displayed by the dialog box |
Replace Warning |
Boolean |
"True" (the default) to display a confirmation dialog box if the user chooses an existing filename, "False" to not display a confirmation dialog box |
A string indicating the full path and filename (including file extension) of the chosen file.
shared d_exts_table
on escape do Return(false) end
openfile:
fname = ChooseFileName(d_exts_table, "Save Table As", {{"Replace Warning", "False"}})
if FileCheckUsage({fname},) then do
ShowMessage("File already in use. Please choose again.")
goto openfile
end
on escape default
If the suggested name option includes a valid path, this path will be used in preference to the path supplied by the initial directory option.
If file_types is null, all types of files are listed in the dialog box.
Even if there is only one file type description and specification, it must be a subarray within an array; for example file_types could be {{"Wrokspace", "*.wrkz"}}.
A file type description can have more than one item in the specification, separated by semicolons, such as {{"Workspace, Dataview, Figure, Layout", "*.wrkz;*.dvw;*.fig;*.lay"}}
The file type description will be shown in the Files of Type drop-down list in the File Open dialog box. To show the specification, add it to the file type description in parentheses. The description just labels the file type, while the specification is used to choose the files to display.
on escape do return() end
geo_file = ChooseFileName({ {"Compact (*.cdf)", "*.cdf"},
{"Standard (*.dbd)","*.dbd"}},
"Save As", )
on escape default
Error Type |
Meaning |
Escape |
The user clicked Cancel or hit Escape |
Error |
File_types or one of the options is incorrectly specified |
Function |
Summary |
Gets the path name to an existing directory/folder |
|
Gets the name of an existing file using the Windows File Open dialog box |
|
Gets the names of one or more existing files using the Windows File Open dialog box |
|
Gets the path name to an existing directory/folder |
|
Checks whether files are in use by Maptitude |
|
Gets information about a file |
©2025 Caliper Corporation | www.caliper.com |