Creating a Message [ HP ALLBASE/4GL Developer Self-Paced Training Guide ] MPE/iX 5.0 Documentation
HP ALLBASE/4GL Developer Self-Paced Training Guide
Creating a Message
The first message you will create is the add_prod message.
Menu Path
To access the Messages screen:
1. From the main menu, select the Dictionary option.
2. Choose Messages.
Description
A message can be constructed from a number of items. Most messages have
a literal component. You can also include communication area fields,
variables, file record fields, screen fields, and other items. The HP
ALLBASE/4GL Developer Reference Manual contains a list of all of the
items you can use in messages.
Messages Screen
To enter the field values:
Field Entry Explanation
---------------------------------------------------------------------------------------
Name add_prod The name of the message within the
application.
Type m The type code for this message. Note that
HP ALLBASE/4GL converts your entry to
uppercase, and expands it to the full
message type code. The different available
codes are listed to the right of this
field. You only need to enter the first
character of the message type code.
Response Item Entry not possible. This field only applies to QUERY type
messages. HP ALLBASE/4GL moves the user's
response to the query into the field that
you specify here.
Help Name Entry not possible. The name of the help screen that is
displayed if the user presses the Help
function key while the message is
displayed. This option is only valid for
QUERY, ERROR, and ABORT messages.
Message Construction "New product may be The content of the message. Note that you
added." must start and finish literal text in
messages with double quotes ("). A message
can be up to 160 characters long. If it
exceeds this length, it is truncated to fit
in the message area at the base of the
screen.
To complete the message:
1. Press the Commit Data function key to create this message.
Messages are automatically generated when committed. Once
generated, a message is ready to be used in an application.
Message - file_error
To create another message:
1. To create the file_error message, follow these steps:
Action Explanation
------------------------------------------------------------------------------
Enter file_error The name of the message
Enter ERROR This is an error type message. It requires the
user to reenter the data in the current field.
Press Return This time you have access to the Help field. Leave
it blank for the time being. You can define a help
screen for this message at a later time.
Enter "File error, code:" This is the first part of the message.
Enter *IOSTATUS The current value of the file return code, which is
stored in the *IOSTATUS communication area, is
included in the message when it is displayed.
Enter " has occurred." This is the final part of the message.
Press Commit Data The message is generated automatically.
When HP ALLBASE/4GL displays this message, it joins the three components
together. You must explicitly enter any spaces that you want to appear
between each component. You can define the individual parts of the
message on separate lines. If you include more than one item on a line,
separate the items with spaces.
To create the remaining message:
1. Now create the remainder of the messages.
Only the essential information for each message is listed here.
a. Message - prod_add_ok
Name prod_add_ok
Type MESS
Contents "Product added successfully."
b. Message - prod_modify_ok
Name prod_modify_ok
Type MESS
Contents "Product modified successfully."
c. Message - prod_delete_ok
Name prod_delete_ok
Type MESS
Contents "Product deleted successfully."
d. Message - prod_add_fail
Name prod_add_fail
Type WARN
Contents "This product already exists. "
"It cannot be added to the file."
e. Message - no_product
Name no_product
Type WARN
Contents "This product does not exist. "
f. Message - prod_delete_fail
Name prod_delete_fail
Type WARN
Contents "This product has NOT been deleted. "
All the messages necessary at this stage of application
development are now complete.
The final step to the expansion of this application is to define a
validation range to automatically validate product numbers as they are
entered by the user. You will do this in the next lesson.
MPE/iX 5.0 Documentation