Skip to content

ERRORBOX ​

ERRORBOX opens a message window displaying some text and waits for the user to press some button.

Syntax ​

leo-grammar
CC "AdoScript" ERRORBOX strValue [ title:strValue ] 
					[ ok | ok-cancel | yes-no | yes-no-cancel | retry-cancel ] 
					[ def-ok | def-cancel | def-yes | def-no | def-retry ]  

# --> RESULT endbutton:strValue
CC "AdoScript" ERRORBOX strValue [ title:strValue ] 
					[ ok | ok-cancel | yes-no | yes-no-cancel | retry-cancel ] 
					[ def-ok | def-cancel | def-yes | def-no | def-retry ]  

# --> RESULT endbutton:strValue

Parameters ​

  • <main-parameter> (strValue) - the text to be displayed
  • title (strValue, optional) - the window title
  • ok(modifier, optional) - flag through which just the OK button is shown in the window
  • ok-cancel(modifier, optional) - flag through which the OK and the CANCEL buttons are shown in the window
  • yes-no(modifier, optional) - flag through which the YES and the NO buttons are shown in the window
  • yes-no-cancel(modifier, optional) - flag through which the YES, NO and CANCEL buttons are shown in the window
  • retry-cancel(modifier, optional) - flag through which the RETRY and the CANCEL buttons are shown in the window
  • def-ok(modifier, optional) - marks the OK button if available in the window
  • def-cancel(modifier, optional) - marks the CANCEL button if available in the window
  • def-yes(modifier, optional) - marks the YES button if available in the window
  • def-no(modifier, optional) - marks the NO button if available in the window
  • def-retry(modifier, optional) -marks the RETRY button if available in the window

Returns ​

  • endbutton (strValue) - contains the name of the button the user pressed (see examples).

Details ​

After the user clicks a button, the message window closes and the execution of the AdoScript is resumed.

Depending on the type or the messagebox, different icons are displayed.

By entereing one of the arguments ok, ok-cancel, yes-no, yes-no-cancel or retry-cancel, you can specify which buttons the ERRORBOx should display. By entereing one of the arguments def-ok, def-cancel, def-yes, def-no or def-retry, you can specify which of the buttons is the default button.

The text of the shown on the buttons depends on the language of the used OS, but the string returned in endbutton is independent from the OS language.

See Also ​

QUERYBOX
WARNINGBOX

Examples ​

asc
CC "AdoScript" ERRORBOX "Something happened, should we continue?" yes-no def-no
CC "AdoScript" INFOBOX ("The user pressed " + endbutton)

CC "AdoScript" QUERYBOX "Choose a button..." yes-no-cancel def-cancel
CC "AdoScript" INFOBOX ("The user pressed " + endbutton)

CC "AdoScript" WARNINGBOX "Another example..." retry-cancel
CC "AdoScript" INFOBOX ("The user pressed " + endbutton)
CC "AdoScript" ERRORBOX "Something happened, should we continue?" yes-no def-no
CC "AdoScript" INFOBOX ("The user pressed " + endbutton)

CC "AdoScript" QUERYBOX "Choose a button..." yes-no-cancel def-cancel
CC "AdoScript" INFOBOX ("The user pressed " + endbutton)

CC "AdoScript" WARNINGBOX "Another example..." retry-cancel
CC "AdoScript" INFOBOX ("The user pressed " + endbutton)

Starts a ERRORBOX and then prints the return variable endbutton in an INFOBOX. The error box has the buttons "yes" and "no". The default button is the "no" button.

Starts a QUERYBOX and then prints the return variable endbutton in an INFOBOX. The query box has the buttons "yes", "no" and "cancel". The default button is the "cancel" button.

Next, a WARNINGBOX is started. Available buttons are "retry" and "cancel". No default button is specified so ADOxx picks its own. After clicking a button, the result is again displayed in an INFOBOX.

Versions and Changes ​

Available since ADOxx 1.3