U_MESSAGE

Display a message

WTSupported in traditional Synergy on Windows
WNSupported in Synergy .NET on Windows
USupported on UNIX
VSupported on OpenVMS
xcall U_MESSAGE(message([,D_BELL|D_NOBELL], [D_ALERT|D_ERROR])

message

The message to display. (a)

D_BELL | NOBELL

(optional) Ring the terminal bell (default) or don’t ring the terminal bell. (n)

D_ALERT | D_ERROR

(optional) Do alert processing (default) or do error processing. (n)

U_MESSAGE displays a message in a message window. If your message requires a Yes/No or OK/Cancel type of response, see %U_MSGBOX.

U_MESSAGE on Windows

In traditional Synergy, U_MESSAGE creates a Windows-style message box with an icon and an OK button. The icon is an information icon (i) if you pass D_ALERT or an exclamation point (!) if you pass D_ERROR.

In Synergy .NET, Toolkit uses a cell-based-style message box if g_netnativemsgbox (a field in tools.def) is set to false, which is the default. If g_netnativemsgbox is set to true, Toolkit uses a native Windows message box.

Insert \n to specify explicit line breaks in message. To include the characters “\n”, prefix the characters with another backslash. For example, the following displays a two-line message with “First” in the first line and “Second” in the second:

xcall u_message("First\nSecond")

The next example displays only one line, “C:\maps\northHaven”:

xcall u_message("C:\maps\\northHaven")

U_MESSAGE cannot time out on Windows.

U_MESSAGE on UNIX and OpenVMS

On UNIX and OpenVMS, U_MESSAGE performs the following steps:

1. Looks for an existing message window called u_message.

If it cannot find an existing u_message window, it looks in the window library opened on g_utlib. If it cannot find a u_message window in the library, U_MESSAGE creates a message window and places it 12 lines above the information line. (You can change the rendition of the message window with the U_REND subroutine.)

2. Displays message in the u_message window.

If message is longer than 76 characters it will be divided up into a maximum of 5 lines with up to 76 characters each. This will be done by searching for the space or tab nearest to, but not beyond, the 76th character after the previous break.

If the u_message window already exists, it should be 5 lines long. U_MESSAGE will shorten the display area of the existing u_message window, if necessary, to the appropriate height (based on the number of lines message takes).

If U_MESSAGE creates the window, the created window’s display area will be two columns wider than the length of the message’s longest line and have a height determined by the number of lines (not to exceed five lines).

3. Calls U_WAIT, which creates another message window telling the user what to do, and waits for a user response.
Note

If you supply a window for U_MESSAGE, you may also want to supply a window for U_WAIT. If you don’t, the U_WAIT window will be centered three lines above the information line, which may not match the placement you specified for the U_MESSAGE window. (Note that this is not true for %U_MSGBOX; if you supply a window for %U_MSGBOX, the selection window will be placed relative to the %U_MSGBOX window.)

If a time-out occurs, g_select is set to true and g_entnam is set to the entry name specified in tkctl.def for g_time_entry. By default, g_time_entry is defined as “O_TIMEOUT”.

4. Removes the message window from the screen prior to exiting the subroutine.
Note

The terminal bell will not ring if g_beep is set to false. See g_beep.

This example displays the message “Invalid Customer Account” in the message window and waits in the error state for a user response.

xcall u_message("Invalid Customer Account", D_ERROR)