dialog.ask

Syntax dialog.ask (prompt, addr)

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

addr is the Object Database location where the user's response will be stored as a string.

Action Displays a dialog containing prompt, a text input field, and two buttons, one labeled "OK" and the other labeled "Cancel." The initial contents of addr, if any, are used as the suggested default response. It then waits for the user to click on one of

the buttons. If the user clicks on "OK," it transfers the contents of the text input field to addr. If the user clicks "Cancel," the original contents of addr are left unchanged.

Returns True when the user clicks on OK, false if cancelled

Examples dialog.ask ("Please enter your name:", @scratchpad.x)

   » true

Object Database location scratchpad.x contains user's answer.

Notes Use this dialog to ask the user for a brief response that takes the form of a string.

If you need to ask the user for a numeric response, dialog.getInt is a more succinct dialog that ensures a number is entered.

See Also dialog.getInt

Discuss