MESSAGE

Purpose:

Displays a message box with an OK, Cancel, Yes and/or No buttons.

Syntax:

MESSAGE("label", "message", type)

"label"

-

Optional string to label the top of the message box.

"message"

-

A string for the message within the box.

type

-

Optional. An integer, the message box type. Specifies the icon and buttons within the box. Defaults to 3. Valid arguments are:

  1:

A question mark icon, OK and Cancel buttons.

  2:

An exclamation point icon, OK and Cancel buttons.

  3:

An "I" (information) icon, and OK button (default).

  4:

A stop sign icon, and OK button.

  5:

A question mark icon, Yes and No buttons (defaults to Yes).

  6:

An exclamation point icon, Yes and No buttons.

  7:

A question mark icon, Yes, No, and Cancel buttons.

  8:

An exclamation point icon and OK button.

  9:

A question mark icon, Yes and No buttons (defaults to No).

10:

A question mark icon, Yes, Yes to All, No and Cancel buttons (defaults to Yes).

Returns:

An integer, the message box return value:

For types 1 and 2:

1=OK, -1=Cancel

For types 3, 4 and 8:

1=OK

For types 5, 6 and 9:

1=Yes, 0=No

For type 7:

1=Yes, 0=No, -1=Cancel

For type 10:

1=Yes, 2=Yes to All, 0=No, -1=Cancel

Example:

message("Test Message")

 

pops up a message box with an "I" sign.

Example:

message(sprintf("Max: %g Min:%g", max, min))

 

pops up a message box that displays the maximum and minimum of the current window.

Example:

To make multiple lines, use the STRESCAPE function:

 

message(strescape(sprintf("Max: %g\nMin: %g", max, min)))

 

same as above except the maximum and minimum are reported on two lines.

Example:

message("Warning", "Value out of Range", 4)

 

pops up a warning message with a stop sign and a single OK button.

Remarks:

MESSAGE is useful in SPL files and Command files when automating processes.

See Also:

DISP

ECHO

PRINTCONSOLE

PRINTF

SPRINTF

STRESCAPE

VIEWTEXT