DP4 provides message manager libraries for C and QA Build. In both cases, a source module supplies you with the data structure and functions you need to call the message manager.
In C, you run the message manager code generation utility MSGMAKE. MSGMAKE reads your compiled parameters and generates a C source module. The C source module defines the data structure for storing messages in the format you specify. The source module defines the functions, including:
|
Initialise and test the parameter set |
|
Translate the data into the message structure |
|
Translate the message structure into the component parts |
When you wish to translate a record in your C program, you call the compose() function. You pass the identification number of the message parameter, and a pointer to the block in memory that is to store the message.
You call decompose() when you wish to translate a message, and read the values into fields. You pass the identification number of the message parameter, and a pointer to the start of the message in memory.
In QA Build, you incorporate message manager as a C Exit. To do this, you link the message manager library with the QA Build module. In your QA Build program, you set up a message table that references the message parameter you are using.
All the messages sent and received by your program are stored in the message table. To compose or decompose a message, you set up a procedure that executes the msg_comp() or msg_decomp() functions.