Skip to content

FILE_DIALOG

FILE_DIALOG shows a file selection dialog.

Syntax

leo-grammar
CC "AdoScript" FILE_DIALOG	Mode 
							[ path:strValue ] [ filename: strValue ]
							[ filter1:strValue type1:strValue ]
							[ filter2:strValue type2:strValue ]
							...
							[ filtern:strValue typen:strValue ]
							[ default-ext:strValue ]

Mode :		Open | SaveAs .

Open :		open [ multi-sel: boolValue ] .

SaveAs :	saveas .

# --> RESULT endbutton:strValue path:strValue
CC "AdoScript" FILE_DIALOG	Mode 
							[ path:strValue ] [ filename: strValue ]
							[ filter1:strValue type1:strValue ]
							[ filter2:strValue type2:strValue ]
							...
							[ filtern:strValue typen:strValue ]
							[ default-ext:strValue ]

Mode :		Open | SaveAs .

Open :		open [ multi-sel: boolValue ] .

SaveAs :	saveas .

# --> RESULT endbutton:strValue path:strValue

Parameters

  • open (modifier) - in open mode, the file dialog is displayed as a "Open file" dialog. By default, you can select exactly one file.
  • multi-sel (boolValue, optional) - when true, more than one file can be selected.
  • saveas (modifier) - in saveas mode, the dialog is displayed as a "Save file" dialog.
  • path (strValue, optional) - selects the starting directory in which the file dialog should be opened
  • filename (strValue, optional) - if given, it is preset in the field for the filename.
  • filteri (strValue, optional) - description for filetypes, i should be replaced with number of filter
  • typei (strValue, optional) - extension of file types, i should be replaced with number of type
  • default-ext (strValue, optional) - the default file extension

Returns

  • endbutton (strValue) - contains the name of the button the user pressed.
  • path (strValue) - contains the absolute path to the file the user selected in the dialog.

Details

Relative paths relate to the current working directory (CWD).

By default only one file can be selected. When multi-sel is set, multi-selection is allowed.

In open mode, when multi-sel is set, path is an array of such file name strings.

See Also

Examples

asc
CC "AdoScript" FILE_DIALOG open 
   filter1:"XML Files" type1:"**.xml" default-ext:"xml"
   filter2:"HTML Files" type2:"**.htm" 
CC "AdoScript" INFOBOX ("You selected " + path)
CC "AdoScript" FILE_DIALOG open 
   filter1:"XML Files" type1:"**.xml" default-ext:"xml"
   filter2:"HTML Files" type2:"**.htm" 
CC "AdoScript" INFOBOX ("You selected " + path)

Starts a file dialog with two filters, one for html and one for xml files.

Versions and Changes

Available since ADOxx 1.3