Previous Page: CPXmpsreadFirst PageNext Page: CPXmsgstr

CPXmsg


Description

The CPXmsg() routine writes a message to a specified channel. Like the C function printf, it takes a variable number of arguments comprising the message to be written. The list of variables specified after the format string should be at least as long as the number of format codes in the format. The format string and variables are processed by the C library function vsprintf() or a substitute on systems that do not have the vsprintf() function.

The formatted string is limited to 1024 characters, and is usually output with the C function fputs() to each output destination in the output destination list for a channel, except when a function has been specified by the CPXaddfuncdest() routine as a destination.

The CPLEX Callable Library uses CPXmsg() for all message output. The CPXmsg() routine may also be used in applications to send messages to either CPLEX-defined or user-defined channels.

CPXmsg() is the only CPLEX routine not requiring the CPLEX environment parameter.

Return Value

Upon completion, CPXmsg() returns the number of characters in the formatted result string.

Synopsis

int CPXmsg (CPXCHANNELptr channel,
            char *format,
            (Any types)...);

Arguments


CPXCHANNELptr channel
The pointer to the channel receiving the message.

char *format
The format string controlling the message output. This string is used in a manner identical to the format string in a printf() statement.

(Any types)...
The list of variables to be printed in the message.

Example

CPXmsg (mychannel, "The objective value was %f.\n", objval);

See Also

Example lpex5.c in the CPLEX User's Manual.

Previous Page: CPXmpsreadFirst PageNext Page: CPXmsgstr