MSGBOX() Function - Create Message Box Dialog
Syntax
MSGBOX(str1{,expr}{,str2}{,ERR=lineref})
Description
For BBj-specific information, see the MSGBOX()
Function - BBj.
The MSGBOX() function creates a message dialog box and returns a value
that identifies the user-selected button.
Parameter |
Description |
||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
str1 |
Dialog box message text. Lines are automatically broken at the right edge of the dialog box. To force a line break, insert a line-feed character ($0A$) before the first character of a line. |
||||||||||||||||||||||||||||||||||||||||
expr |
Numeric expression
that identifies the dialog's buttons, icons, default button, and
modal setting.The values are additive and can be expressed in one of two ways.
(1+48+256+0)
|
||||||||||||||||||||||||||||||||||||||||
str2 |
Dialog box title text. If this parameter is omitted, the program name is used as the title. |
||||||||||||||||||||||||||||||||||||||||
ERR=lineref |
Branch to be taken if an error occurs during execution. |
Returned Values
The value returned by MSGBOX() identifies which button the user selects, as follows:
Value |
Button Selected |
---|---|
1 |
OK |
2 |
Cancel |
3 |
Abort |
4 |
Retry |
5 |
Ignore |
6 |
Yes |
7 |
No |
Examples
Example 1
The following creates a dialog that displays "This is a message" and an OK button. In addition, it uses the program name as the dialog title and returns a value of 1:
let x=msgbox("This is a message")
Example 2
The following creates a dialog that displays the contents of MESSAGE$ as the message text; contains Cancel and Retry buttons and a question mark icon; and displays the contents of TITLE$ as the dialog title.
let x=msgbox(message$,5+32+256,title$)
Selecting the Cancel button (default) returns a value of 2. Selecting the Retry button returns a value of 4.
See Also
Functions - Alphabetical Listing