Navigation: thinBasic Modules > Core > General > InputBox$ |
|
Description
Displays a dialog box containing a prompt. Waits for the user to enter text, and accept or cancel the dialog. Returns the contents of the text box.
Syntax
s = InputBox$(Prompt [, Title [, DefaultText ] ] )
Returns
String
Parameters
Name |
Type |
Optional |
Meaning |
Prompt |
String |
No |
|
Title |
String |
Yes |
|
DefaultText |
String |
Yes |
Remarks
Restrictions
See also
Examples
Thanks to Mark_D for the following script example
Dim s As String VALUE = ""
Dim Prompt As String VALUE = "Enter Some thing here"
Dim Title As String VALUE = "InputBox Example" '---Optional, can be left out
Dim DefaultText As String VALUE = "press keyboard keys to change me" '---Optional, can be left out
Dim sMsg As String VALUE = ""
'---Assign the variable 's' to what is entered in the INPUTBOX
s = InputBox$(Prompt ,Title, DefaultText )
'---Prepare the 'sMsg' variable
sMsg = " You entered: " & $CRLF
sMsg += s & $CRLF
'---Display a MessageBox to show what the user entered in the INPUTBOX
msgbox 0, sMsg
© 2004-2008 thinBasic. All rights reserved. | Version 1.7.0.0 | Web Site: http://www.thinbasic.com |