EMS Manual

Retrieving Event Messages Programmatically
EMS Manual426909-005
4-18
Generating Display Text (EMSTEXT)
Generating Display Text (EMSTEXT)
Event messages contain information in a form most suitable for programmatic access,
rather than for display. To obtain text suitable for display, use the EMSTEXT Procedure
on page 15-19.
EMSTEXT lets you specify several parameters that control the form of its output:
The event message buffer.
The length of each line of text.
The maximum number of lines of text.
The amount that the second and subsequent lines of text are indented relative to
the first line. A positive integer specifies the number of characters of indentation.
Zero indicates no indentation. A value of -1 specifies that the lines be indented by
the width of the header information in the first line. If you omit the parameter, -1 is
used.
The format of the text message: a user-selected format or DSM display format.
User-selected formats are possible with format templates. For information, see the
DSM Template Services Manual.
EMSTEXT returns the text and the number of characters used in each line.
This example shows an EMSTEXT call to generate up to five lines of display-format
text. Each line can be 80 characters long and is indented by the width of the message
header.
Literal maxlines = 5,
maxlength = 80;
String .textbuffer [0 : maxlines*maxlength - 1];
Int .linelengths[0 : maxlines-1];
Int(32) emstext^err;
emstext^err :=
EMSTEXT(emsbuffer, !event message for text generation
textbuffer, !holds the generated text
maxlength, !80-char-length lines
maxlines, !up to five lines
linelengths, !lengths of lines in textbuffer
, !for Compaq use only
, !default indent
);
!Use of emstext^err is optional.
if emstext^err <> 0D then ...
This EMSTEXT call results in returned parameters containing this information.