ask()

Examples


The ask() function creates a dialog box containing a message and up to three user-defined buttons. It returns a value indicating which button is clicked by the user. The dialog box may also contain a Help button that will reference a specified entry in the help system.

Syntax

ask(prompt, button1, button2, button3 {, context_number})

Parameters

prompt – A string field, text field or string or text value with the message to be displayed in the dialog box.

button1 – A string containing the label for the first button in the dialog box.

button2 – A string containing the label for the second button in the dialog box.

button3 – A string containing the label for the third button in the dialog box.

context_number – A long integer specifying a help context number associated with a specific topic in the online help file for the current dictionary. If this parameter is used, a Help button will appear in the dialog box. If a user presses the Help button, the specified help file topic will be displayed.

Return value

An integer indicating which button the user clicked. It corresponds to one of the following constants: ASKBUTTON1, ASKBUTTON2 or ASKBUTTON3.

Comments

If you want to use fewer than three buttons in the dialog box, use the empty string ("") for the buttons you don’t want to use. For example, to display only two buttons, supply the button text for the first two buttons and the empty string for the third button.

The window closes automatically after the user clicks a button.


Documentation Feedback