Error getting tags :
error 404Error getting tags :
error 404 ask | revDocs | RunRev
Welcome Guest (Log in)
Product Edition
Expander triangle

ask [iconType] question [with defaultResponse] [titled windowTitle] [as sheet]

Platform Support
MacOS,Mac OS X,Windows,Linux
None required
Displays a dialog box with a question, a text box for the user to enter a response, and OK and Cancel buttons.

ask "What is your name?"
ask "Please enter your occupation:" with "Geek"
ask field "Prompt" with firstGuess titled "Guess!"
ask myPrompt as sheet

Additional Comments
Expander triangle

Use the ask command when a handler needs to get information from the user before continuing.


The iconType parameter is one of the following types: information, question, error, or warning. The icon is displayed on the left side of the dialog box. If you don't specify an icon, none is displayed.

The question parameter is a string of formatted (or unformated) text.

Cross-platform note: On OS X systems, there is no image for the question icon. Therefore, the information icon appears instead. In addition, the image specified by the gRevAppIcon keyword appears if you don't specify an iconType. If you specify an iconType, the image specified by the gRevSmallAppIcon keyword appears instead, along with the standard icon specified by the iconType.

The question is a string (or any expression that evaluates to a string).

The defaultResponse is a string, and is placed in the text box when the dialog box appears. If no defaultResponse is specified, the text box is empty when the dialog box appears.

The windowTitle appears in the title bar of the dialog box. If no windowTitle is given, the title bar is blank.


The contents of the text box is placed in the it variable. If the user cancels the dialog, the it variable is set to empty and the result function returns "cancel".

If the sheet form is used, the dialog box appears as a sheet on OS X systems. On other systems, the as sheet form has no effect and the dialog box appears normally. Attempting to open a sheet from within another sheet displays the second stack as a modal dialog box instead.

Changes to Revolution:

The ability to specify an iconType was added in version 2.0. In previous versions, no icon was displayed.

The sheet form was introduced in version 2.0.

The ability to provide formatted text for the prompt was introduced in version 2.0.

User Comments
Expander triangle