INPUTBOX$: 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
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:_INPUTBOX$}} | {{DISPLAYTITLE:_INPUTBOX$}} | ||
The '''_INPUTBOX$''' function displays a prompt in a dialog box, waits for the user to input text or click a button, and returns a string containing the contents of the text box. The returned string is an empty string ('''""''') if the user cancelled. | The '''_INPUTBOX$''' function displays a prompt in a dialog box, waits for the user to input text or click a button, and returns a string containing the contents of the text box. The returned string is an empty string ('''""''') if the user cancelled. | ||
{{PageSyntax}} | {{PageSyntax}} |
Revision as of 00:43, 29 January 2023
The _INPUTBOX$ function displays a prompt in a dialog box, waits for the user to input text or click a button, and returns a string containing the contents of the text box. The returned string is an empty string ("") if the user cancelled.
Syntax
- result$ = _INPUTBOX$(title$, message$[, defaultInput$])
Parameters
- title$ is the dialog box title
- message$ is the message or prompt that will is displayed in the dialog box
- defaultInput$ is a string that is displayed in the text box as the default response if no other input is provided
Description
- All parameters accept an empty string ("") in which case system defaults are used
- Use message$ to specify instructions to the user
- If defaultInput$ is an empty string (""), then a password box is shown, and the input is masked
- The dialog box automatically becomes a modal window if the application window is visible
Availability
- QB64-PE v3.4.0 and up
Examples
- Example
- Hello, world with common dialogs
username$ = _INPUTBOX$("Hello App", "Enter your name:", "anonymous") IF username$ <> "" THEN _MESSAGEBOX "Hello App", "Hello " + username$, "info" |
See also
- _NOTIFYPOPUP
- _MESSAGEBOX
- _MESSAGEBOX (function)
- _SELECTFOLDERDIALOG$
- _COLORCHOOSERDIALOG
- _OPENFILEDIALOG$
- _SAVEFILEDIALOG$