ERRerror, ERRverror


Synopsis

void ERRerror (const char *package, int count, int mode, const char *format, ...)

void ERRverror(const char *package, int mode, const char *format, ...)

Description:

ERRerror prints out error messages. If there are no installed error handlers,the messages are sent to the error stream, which defaults to stderr.If the Network Editor is active, it installs a error handler that directs the messages to error window.

 

ERRerror prints a warning, informational or error message. The message will go to the either the console window or the error dialog window depending upon the state of the system. The message is formated as follows:

--- <Error detected in/Warning from/Information from>: <package> ----- <body of error message>-------

On the PC platform, modules written in the user process do not have direct access to the console window with the printf routine. This routine will redirect these messages via a RPC call to the express process where the message will either be displayed in the error dialog or in the console window.

Parameters:

package

Name of the package or module that is printing out an error message.

 

count

Number of extra arguments to use to format the error message. Do not count

the format string itself. Valid values are from 0 to 5.

Not needed if you use ERRverror.

 

mode

ERR_ERROR Message is to be regarded a an error

ERR_ORIG Same as ERR_ERROR

ERR_WARNING Message is to be regarded as a warning

ERR_INFO Message is to be regarded as information

 

format

format string is used as the basis of the error message. It will

be passed to the C function sprintf along with any extra arguments.

 

extra arguments

Extra arguments to be passed to sprintf along with the format string.

Also of note:

If you are not using Network Editor the error messages will show up in the VCP. If you need them to be in a MessageBox then add this to the application:

// Set up the error handler that will redirect messages to the

// display

//

GMOD.err_handler ErrorHandler {

enabled => 1;

};

UI_MACROS.UIerrorDisplay Error_Dialog {

     message_nl => ErrorHandler.num_lines;

     message => ErrorHandler.err_message;

};

Examples:

ERRerror("orthoslice", 0, ERR_ORIG, "Can't get plane" );

 

ERRerror( "orthoslice", 1, ERR_ORIG,

"Error while processing field: %d", i );

 

ERRverror( "orthoslice", ERR_ORIG,

"Error while processing field: %d", i );