InputBox: Difference between revisions
Created page with "INPUTBOX(''prompt''[, ''title''[, ''default''[, ''xpos'', ''ypos'']]]) '''Description''' INPUTBOX opens a dialog box to prompt a user to input text or click a button. A stri..." |
No edit summary |
||
Line 1: | Line 1: | ||
INPUTBOX(''prompt''[, ''title''[, ''default'' | INPUTBOX(''prompt''[, ''title''[, ''default'']]) | ||
'''Description''' | '''Description''' | ||
INPUTBOX opens a dialog box to prompt a user to input text or click a button. A string is returned containing the contents of the text field from the dialog box. The required parameter, ''prompt'', is a string expression that is displayed in the body of the dialog box. The optional parameter, ''title'', is | INPUTBOX opens a dialog box to prompt a user to input text or click a button. A string is returned containing the contents of the text field from the dialog box. The required parameter, ''prompt'', is a string expression that is displayed in the body of the dialog box. The optional parameter, ''title'', is ignored: it is only for backwards compatibility. The optional parameter, ''default'', is a string expression that is displayed in the text field of the dialog box. | ||
If the user taps OK or presses the Enter key, INPUTBOX returns the text in the input field or an empty string ("") if the input field is empty; if the user taps Cancel or presses the escape key (Esc), INPUTBOX returns | If the user taps OK or presses the Enter key, INPUTBOX returns the text in the input field or an empty string ("") if the input field is empty; if the user taps Cancel or presses the escape key (Esc), INPUTBOX returns “null”. | ||
'''Example''' | '''Example''' | ||
Line 11: | Line 11: | ||
<pre> | <pre> | ||
DIM Return | DIM Return | ||
Return = INPUTBOX("Message area", | Return = INPUTBOX("Message area", "", "Default text") | ||
PRINT "You entered:", Return | PRINT "You entered:", Return | ||
</pre> | </pre> | ||
Line 19: | Line 18: | ||
<pre> | <pre> | ||
[[InputBox:InputBox.jpg]] | |||
You entered: Default Text | You entered: Default Text | ||
</pre> | </pre> | ||
'''Related Items''' | |||
[[nsb.inputbox|NSB.INPUTBOX]] |
Revision as of 03:48, 10 July 2012
INPUTBOX(prompt[, title[, default]])
Description
INPUTBOX opens a dialog box to prompt a user to input text or click a button. A string is returned containing the contents of the text field from the dialog box. The required parameter, prompt, is a string expression that is displayed in the body of the dialog box. The optional parameter, title, is ignored: it is only for backwards compatibility. The optional parameter, default, is a string expression that is displayed in the text field of the dialog box.
If the user taps OK or presses the Enter key, INPUTBOX returns the text in the input field or an empty string ("") if the input field is empty; if the user taps Cancel or presses the escape key (Esc), INPUTBOX returns “null”.
Example
DIM Return Return = INPUTBOX("Message area", "", "Default text") PRINT "You entered:", Return
Output
[[InputBox:InputBox.jpg]] You entered: Default Text
Related Items