|
VADELIA |
|
WADELIA |
|
(I) (C/S) |
(I) (C/S) |
Section for use
VERIFICATION and procedure
Syntax
PREPARE_MSG MsgNumOrAlphaVarId GraphicObjectId Mode
MsgNumOrAlphaVarId |
→ |
MsgNum | &AlphaVarId |
Mode |
→ |
*BOX | None |
Description
This instruction prepares a message to be displayed in the event of an error, anomaly or warning.
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 ALPHA(7) that contains the message's full name (prefix + message number).
The instruction is authorised in a procedure only if it is directly called from a VERIFICATION paragraph. In this case, the graphical object must be described by the name of its window or page and must belong to the window (or page) corresponding to the VERIFICATION paragraph which called the procedure.
Visual Adelia Context
The message appears in a message box, and may or may not interrupt processing, depending on the Mode set.
If the mode is set to *BOX, the message box will suspend the application until the user clicks on the OK button.
Adelia Web Context
If the mode is set to *BOX, the message will appear in a box which is displayed above the browser window. The user has to click on the OK button to close the message box.
If the mode is not set to *BOX, the message will display at the place where the error tag (with the same name as the graphic object) is, if it exists. Otherwise, the error message appears at the place where the standard error tag is.
Important note: ERROR, ANOMALY, and WARNING instructions corresponding to a PREPARE_MSG instruction in *BOX mode are not permitted in server blocks.
Example
IF Z_AMOUNT = 0
PREPARE_MSG 0011 Z_AMOUNT
ANOMALY
END
MESSAGENAME = 'MSG0012'
* where MESSAGENAME is declared as ALPHA(7)
IF Z_AMOUNT > WMAX_AMOUNT
PREPARE_MSG &MESSAGENAME Z_AMOUNT
ANOMALY
END