ADELIA |
|
|
|
|
(I) |
|
|
|
|
Section for use
VERIFICATION
Syntax
PREPARE_MSG MsgNumOrAlphaVarId VarId
MsgNumOrAlphaVarId |
Þ |
MsgNum | &AlphaVarId |
Description
This instruction is used to prepare the display of an error message.
PREPARE_MSG therefore declares the message to be displayed when the corresponding error is detected.
This message must already be defined in the message glossary.
This instruction also specifies the variable VarId displayed in reverse image mode and on which the cursor is positioned when the error message appears on the screen.
The message identifier MsgNum is defined as 4 characters (message number) or 7 characters (prefix + message number).
The variable AlphaVarId must be a seven-character alpha variable that contains the message's full name (prefix + number).
Important note: AlphaVarId variables can only be used in error message subfile mode, and only for the RPG generator.
The message must appear in the message file.
To take effect, the instruction must be followed either by:
You can manage the display of one or more messages on the screen. To manage the display of several messages, you must work in error message subfile mode.
See the check box "Error messages" in a screen standard layout definition, and the check box "Error messages subfile" in the General Characteristics of a Program in the SSG.
Messages are stored in a subfile displayed on the predefined line.
You have to roll-up the message line to see the following messages appear.
The overall structure of a control is as follows:
-
Declaration of the error message to be sent:
-
-
- PREPARE_MSG
-
-
Information control
Personalization of the message (optional):
-
Triggering of the detected error:
-
-
- WARNING
- ERROR
- ANOMALY
-
Note: The PREPARE_MSG instruction is equivalent to the PROCEDURAL_RULE instruction.
Example
IF Z_SALES_AMOUNT = 0
PREPARE_MSG 0011 Z_SALES_AMOUNT
ANOMALY
END
*
CHAIN PAYMENTS
IF PAYMENTS DOES_NOT_EXIST
PREPARE_MSG 0013 Z_PAYMENT_CODE
INIT_MSG Z_PAYMENT_CODE
ANOMALY
END
If sales amount is equal to zero and payment code is not correct, then messages 0011 and 0013 are both loaded in the error message subfile
because of the ANOMALY instruction;
message 0013 contains the value of the wrong payment code (INIT_MSG);
both screen fields are reversed; the cursor is on Z_SALES_AMOUNT;
message 0011 is the first one displayed; pressing the "roll-up" key when the
cursor is on the message subfile will display message 0013.
See also the list of 4GL instructions by topic