message

Display the specified string in the message line (if it is available), or an interactive dialog box.

message{/nobeep}{/error | /warning | /info}  MessageText

message/clear  MessageText

message/hint  MessageText

Example: message "Store error number %%$status."

Qualifiers

Qualifiers
Qualifier Description
/nobeep Prevents a audio signal when MessageText is displayed. This switch has no effect in the web environment.
/info
/warning
/error
Display the message in a dialog box that requires confirmation. In a GUI, these switches also display an icon showing the indicated severity. If you specify several levels of severity, the most severe switch of those specified is used.
/clear Clears the message line. In GUI mode, the message line is cleared, but the history list for the message line is not changed. In character mode, the 'Busy' indicator is restored, if necessary.
/hint Displays a message in the message line without logging it in the history list of the message line, and without beeping.

In Form components, it is commonly used in the getFocus trigger to display hint information about the field.

Parameters

Parameters
Parameter Data Type Description
MessageText String Text to display; maximum length is 512 bytes.

Return Values

None

Use

message/error, message/warning, message/info, , message/clear and message/nobeep allowed in form and static server page components (and in service and report components that are not self-contained).

message and message/hint allowed in form, service, and report components.

Description

The message statement sends MessageText to the message line, if it is available.

In GUI mode, the location and appearance of the message line depends on the GUI in use. In character mode, the message line is defined as part of the application shell definition. On Windows platforms, the message line is visible at the bottom of the application shell (by default), but it is possible to hide or show it using the messageline property. For more information, see Message Line.

If the message needs to be written to a log file, use the $putmess statement and set $PUTMESS_LOG_FILE in the assignment file.

In batch mode, the message content is written directly to the screen or to a batch log file, depending on your operating system settings. No user intervention is required.

Web Environment

Note:  For Dynamic Server Pages, use the webmessage statement, which supports icons and enables you to control the size.

For static server pages, you can use message with the switches /info, /error, or /warning to display an alert box. The type of alert is not shown as an icon; instead, the message text is prefixed by the type. For example:

[info] This is my message.

When used without switches or with /hint, message has no effect in contemporary browsers. In very old browsers with a status line, the message is displayed there.

The following example displays the status code with the message statement, if a store operation was unsuccessful:

trigger store
  if ($status < 0)
     message "Store error number %%$status."
     rollback
  endif
end; store

Related Topics