SAVEFILEDIALOG$: Difference between revisions
Jump to navigation
Jump to search
Navigation:
Main Page with Articles and Tutorials
Keyword Reference - Alphabetical
Keyword Reference - By usage
Report a broken link
(Correct return type) |
m (Update optional args behavior) |
||
(One intermediate revision by one other user not shown) | |||
Line 4: | Line 4: | ||
{{PageSyntax}} | {{PageSyntax}} | ||
:{{Parameter|result$}} = [[_SAVEFILEDIALOG$]]({{Parameter|title$}}, {{Parameter|defaultPathAndFile$}}, {{parameter|filterPatterns$}}, {{Parameter|singleFilterDescription$}}) | :{{Parameter|result$}} = [[_SAVEFILEDIALOG$]]([{{Parameter|title$}}][, {{Parameter|defaultPathAndFile$}}][, {{parameter|filterPatterns$}}][, {{Parameter|singleFilterDescription$}}]) | ||
Line 21: | Line 21: | ||
{{PageAvailability}} | {{PageAvailability}} | ||
* '''QB64-PE v3.4 and up''' | * '''QB64-PE v3.4.0 and up''' | ||
Latest revision as of 01:54, 3 June 2023
The _SAVEFILEDIALOG$ function displays a standard dialog box that prompts the user to save a file. The returned string is an empty string ("") if the user cancelled.
Syntax
- result$ = _SAVEFILEDIALOG$([title$][, defaultPathAndFile$][, filterPatterns$][, singleFilterDescription$])
Parameters
- title$ is the dialog box title
- defaultPathAndFile$ is the default path that will be used by the dialog box if not changed by the user
- filterPatterns$ are the file filters separated using "|" (e.g., "*.png|*.jpg|*.gif")
- singleFilterDescription$ is the single filter description (e.g., "Image files")
Description
- All parameters accept an empty string ("") in which case system defaults are used
- If singleFilterDescription$ is an empty string (""), then filterPatterns$ will be shown in it's place
- The dialog box automatically becomes a modal window if the application window is visible
Availability
- QB64-PE v3.4.0 and up
Examples
- Example
- Simple save file dialog example
IF NOT filesaved& THEN textfile$ = _SAVEFILEDIALOG$("Save File", "", "*.txt|*.doc", "Text files") IF textfile$ <> "" THEN filesaved& = -1 _MESSAGEBOX "Information", "File will be saved to " + textfile$ END IF END IF |
See also
- _NOTIFYPOPUP
- _MESSAGEBOX
- _MESSAGEBOX (function)
- _INPUTBOX$
- _SELECTFOLDERDIALOG$
- _COLORCHOOSERDIALOG
- _OPENFILEDIALOG$