ASK Mnemonic - Create a Question Dialog

Syntax

'ASK'(title,iconid,prompt,button1{,button2{,button3}})

Description

For BBj-specific information, see ASK Mnemonic - Create a Question Dialog BBj.

The 'ASK' mnemonic causes a dialog box to appear with the specified title (title) and message text (prompt). An icon may also be displayed for the urgency or nature of the dialog. One to three buttons may appear in the dialog. Execution of the PRO/5 program is suspended until a response is selected or the dialog is closed. If a response is selected, the dialog is dismissed and the response string associated with the selected button is injected into the keyboard buffer to be read with a subsequent READ or INPUT statement. If the dialog is closed, an!ERROR=29is generated by the WRITE or PRINT verb that displayed the dialog.

Parameter

Description

title

Title of the dialog

iconid

Icon to be displayed in the dialog.iconidvalues are displayed in the table below.

prompt

The text message displayed in the dialog.

button1

Label for the first button.

button2

Label for the second button.

button3

Label for the third button.

Availableiconidvalues are:

Value

Icon Selected

0

No icon

1

Informational

2

Warning

3

Query

4

Fatal

Each of the three button strings (button1, button2, and button3) contain the label for a button in the dialog. Any or all buttons may be assigned an accelerator or hot key. Place an ampersand (&) in front of the symbol in the button text that is to be used as the hot key. For example, &Yes sets the button label to "Yes" and the hot key to "Y." As with other Windows applications, the hot key symbol is underlined.

By default, the button label is transmitted as the response string when a button is pressed. However, the response string may be different from the button label. To do this, simply add a colon to the end of the button label, followed by the desired response string. A colon can never appear as part of the button label.

For example, the following program statement displays a dialog prompting the user to answer "Yes" or "No" with hot keys "Y" and "N."

0200 PRINT (0,ERR=9000) 'ASK'("Sample Dialog", 3, "Do you wish to continue?", "&Yes:Y"+$0D$, "&No:N"+$0D$)

The response string for each button is explicitly set to "Y" and "N" with a terminating carriage return. An error branch is supplied if the user dismisses the dialog instead of choosing one of the buttons.

See Also

Mnemonics - Alphabetical Listing

Mnemonics - Group Listing