HP RPG/XL Programmer's Guide (30318-90001)

4-: 15
.
Figure 4-9. Using Escape Sequences
Comments
1 This line displays the escape sequences for homing the cursor
and clearing the screen. The escape character is indicated here
by a ^.
2 This line displays the escape sequence for performing a memory
lock. The escape character is indicated here by a ^.
Using Message Files
A message file is a convenient place to keep the text of messages
displayed in an RPG program. You can alter the text of these messages
when required without recompiling your program. Message files in RPG are
called User Message Catalog files.
To use a message file, you must first create a
source
file containing the
message text. Then, you use either MAKECAT or GENCAT to convert the
source file to a User Message Catalog file. The message files created by
MAKECAT and GENCAT are different. GENCAT message files have a compressed
format, requiring less disc space, and they can be used with the Native
Language Support (NLS) System. Although MAKECAT and GENCAT generate
message files having different physical formats, you access messages in
them the same way within an RPG program.
Creating a Message File. This section explains how to create a message
source file and how to convert it into a User Message Catalog file using
GENCAT. For details on using GENCAT, see the
Native Language Programmer's
Guide
. For information on using MAKECAT to convert the file, see the
Message Catalogs Programmer's Guide
.
Figure 4-10 gives the terminal dialogue for creating a message source
file using EDITOR and for executing GENCAT. (The lines that are shaded
are the ones that a user enters.) Although this example uses EDITOR, you
can use any editor that produces a standard text file. You organize
messages into
sets
(see the $SET lines). Normally, sets contain similar
kinds of messages. Within sets, you enter message text and associated
message numbers. When a message is long, enter it according to how you
want to display it. To display the message as a continuous string of
characters, end message text lines with &. If you want to format the
lines that are displayed, enter each line of text as you want it
displayed, and end each line with a %.
As shown in Figure 4-10, GENCAT converts the message source file, CAT4,
into a User Message Catalog file. It is saved with the name, CATALOG.
(All User Message Catalog files have the name, CATALOG.)