NSB.InputBox

From NSB App Studio
Revision as of 01:26, 24 August 2012 by Brendon (talk | contribs)
Jump to navigation Jump to search

NSB.InputBOox(function, prompt[, title[, default]])

Description

NSB.InputBox presents a modal dialog which prompts the user for an input value. While it is displayed, no other actions may be taken by the user. Unlike InputBox, this function does not halt the program: execution of the next statement will continue immediately. It will not wait for the user’s input. The advantage of this function is that title can be specified.

The function argument is the name of a subroutine or function in your program, which will be called when the control is dismissed. The prompt argument is required. It appears under the title. title is optional: if you do not specify one, the Title of the app will show. default is the initial value to show in the input field.

When the user clicks on OK or Cancel, function will be called with two parameters: the first one will be either vbOK or vbCancel, and the second one will be the value the user entered.

To dimiss an NSB.InputBox from your program instead of waiting for the user, call NSB.closeMsgBox().

Example

Rem Demonstrate NSB.InputBox
Function Button1_onclick() 'InputBox
  NSB.InputBox(Button1done,"What am I thinking?", "InputBox Example")
End Function
 
Sub Button1done(result, value)
  If result=vbOK Then Text3.value=value Else Text3.value="Cancel"
End Sub

Output

(If the user clicked on OK, the value entered will show in Text3.value. If the user cancelled,)

Related Items

InputBox