Sfairadora

  • Reference Guide

select_file_name

select_file_name(init, filter, extension, flags)
select_file_name(init, filter, extension, flags, title)
The function displays the standard operating system dialog for choosing a file name.

Parameters

init
The initial folder and/or file name. If the string specified ends with a backslash (\), it is considered a folder name.
filter
The list of permitted file types. The type of the parameter is Seq(String[2]), i.e. a list of pairs of strings. In every pair, the first member contains a file name mask, while the other contains a human-readable description. If it is necessary to include more than one mask in one string, the masks are separated by a semicolon. Example: {{"*.jpg; *.jpe; *.jpeg", "JPEG Images"}, {"*.gif", "GIF Images"}}.
extension
The file extension to be used when the user does not specify one. The extension is specified without the dot (e.g. "txt").
flags
An Int parameter containing combination of file name selection constants.
title
A String parameter. If specified, it determines the window title of the dialog. If omitted, a standard one is used (“Open” or “Save As”).

Return Value

The function returns a value of the type File_name (File_name is named type String) containing the full path to the selected file. If the user cancels the dialog with the Cancel button, an empty string is returned.

See Also