Displays a File Open dialog box.
This function is a blocking function. It blocks the calling Cicode task until the operation is complete.
Syntax
FormOpenFile(sTitle, sFileName, sFilter, [bResetToDefault])
sFileName:
The name of the default file to display in the "File Name" field.
sTitle:
A title to display at the top of the form.
sFilter:
A file filter list to display in the "List Files of Type" field. The file filter list has the following format:
<File Type>|<Filter>|
where:
File Type
is the text that displays in the drop-down box, for example All Files (*.*). Filter
is the file type, for example *.CI
bResetToDefault
Boolean parameter. When set forces the path to reset to the default path specified.
True = default path specified
False = last file specified
e.g. FormOpenFile(sTitle, sFileName, sFilter [, bResetToDefault = FALSE])
Return Value
The name and full path of the selected file (as a string) or an empty string ("") if the Cancel button is selected.
Related Functions
FormSaveAsFile, FormSelectPrinter
Example
// Display the Open File dialog with the following filter list:
// All Files (*.*)
// Exe Files (*.EXE)
// Cicode Files (*.CI)
sFilename = FormOpenFile("Open", "*.CI", "All Files (*.*)|*.*|Exe Files (*.EXE)|*.EXE|Cicode Files (*.CI)|*.CI|");
See Also
Published June 2018