dialog.getInt

Syntax dialog.getInt (prompt, addr)

Params prompt is a string to be displayed in the dialog.

addr is the Object Database location where the user's response, which must be an integer, will be stored. The initial contents of this location, if any, are the default response.

Action Displays a dialog containing prompt, a number input field, and two buttons, one labeled "OK" and the other labeled "Cancel." It then waits for the user to click on one of the buttons. If the user clicks "OK," the value in prompt replaces the former

contents of addr. If the user clicks "Cancel," the contents of addr are left unchanged.

Returns True if the user hit OK, false if Cancel

Examples dialog.getInt ("How old?", @scratchpad.x)

   » true

Errors Entering a non-numeric value in this dialog dismisses the dialog (thus returning true because the OK button was clicked) and produces an error.

Notes This very small dialog is good for short prompts. For more verbose dialogs, use dialog.ask.

You should keep prompt to 12 or fewer characters because of the small size of this dialog.

dialog.getInt is a Frontier script that demonstrates the use of many of the more advanced dialog-scripting features of the language. Examine its script to understand these advanced capabilities.

See Also dialog.ask

Discuss