$messagebox

Presents a message box to the application user and waits for a response.

Syntax

$messagebox(message,type,style,defaultbutton[,heading])

Parameters

message

A character string, or an expression that evaluates to a character string.

type

A number that determines the type of message box. In graphical environments, type also determines the icon that appears in the message box.

style

A number that determines the responses (push buttons) available to the application user.

defaultbutton

A number that determines which push button is the default button. Buttons are numbered 1, 2, 3 from left to right.

heading

A title for the message box. If you do not specify a heading, one is assigned based on type.

Message box types include:

Type

Meaning

Constant Name

1

Error

cErrorMsg

2

Warning

cWarningMsg

3

Information

cInfoMsg

4

Question

cQuestionMsg

Push button styles include:

Type

Buttons Supplied

Constant Name

1

OK

cOKStyle

2

OK, Cancel

cOKCancelStyle

3

Retry, Cancel

cRetryCancelStyle

4

Yes, No

cYesNoStyle

5

Yes, No, Cancel

cYesNoCancelStyle

6

Abort, Retry, Ignore

cAbortRetryStyle

Return Value

Character string.

Comments

Use $messagebox to display a message in a dialog box of the specified type, with the specified heading or a default heading in the caption. The application user responds by activating one of the buttons provided by style, one of which is a defaultbutton. $Messagebox returns a character string containing the label of the button pressed by the application user.

Example

$messagebox("Delete file?",2,5,2,"File Operations")

 

Related Topics