You are here: Errors Reference > Documaker Standard Edition > Documaker Errors > Creating Messages > Using the RPErrorProc and RPLogProc Functions

Using the RPErrorProc and RPLogProc Functions

Use these two functions when you specify information to be output to the log or error files. You can use these functions to install the custom error and log procedures called from within these functions. The system lets the calling function provide the details of a message without having to specify the exact formatted text.

Here is an example:

RPErrorProc(pRPS, (WORD)EMIT_WARNING, (DWORD)10012,
"OutBuff", pRPS->OutBuff,
"Image", IMAGENAME(pRPS->CurrentFapImageH),
LASTERRORTOKEN);
RPLogProc(pRPS, (WORD)EMIT_MESSAGE, (DWORD)10775,
LASTERRORTOKEN);

Each parameter is discussed below:

RP Struct

The first parameter represents the pointer to the RP Struct active during the run.

Message Types

The second parameter identifies the type of message being reported. There are these classes of messages:

Class

Description

EMIT_MESSAGE

Indicates the resulting information is simply a message.

EMIT_WARNING

Indicates the information is a warning to the user.

EMIT_ERROR

Indicates an error has been encountered by the program.

EMIT_CRITICAL

Indicates a critical error has been encountered that will stop all processing.

The message system recognizes the type of message if you use one of the above defines. Use the EMIT_??? keywords for this parameter and do not rely upon the underlying numeric value. This lets you later change these values or add new values and recompile without invalidating the meaning of a particular message.

Message Number

Use this parameter to specify the message number to associate with the output data.

Message numbers are associated with the TRANSLAT.INI file. This file contains all the static text for each message. The static text is later merged with the variable information to produce the messages written into the log or error files. This table shows the message number ranges:

Range

Description

0 to 49999

Reserved range for Documaker base system messages.

50000 and higher

Can be used for custom messages. The maximum message number in an Oracle message (.MSG) file is 65535.

Assigning numbers to custom messages

The range 50000 and higher is for customization messages, which are generally added when you customize your system. Although you can use previously defined messages, it is better to assign an unused number within the custom range for each message you add.

This makes sure the intended meaning of an existing message is not changed in case someone modifies the text of the assumed custom message in the external file. In addition, if you develop a numbering system for the custom range, you can provide additional debugging information through the message number.

You can add custom messages into the TRANSLAT.INI file, as in version 11.5 and prior releases. The system searches for messages in the Oracle message file first and if not found, the system searches for messages in the TRANSLAT.INI file.