_INPUTBOX$

From QB64 Phoenix Edition Wiki
Revision as of 19:03, 29 October 2022 by A740g (talk | contribs) (Initial version)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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
  • The dialog box automatically becomes a modal window if the application window is visible


Availability

  • QB64-PE v3.4 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



Navigation:
Main Page with Articles and Tutorials
Keyword Reference - Alphabetical
Keyword Reference - By usage
Report a broken link