Share this page

# lr_message

Sends a message to the log and output window.

    int lr_message( char *format, exp1, exp2,...expn.);

Alphabetical Listing - C Language Utility Functions

## Arguments

Name | Comments
--- | ---
format C Language | A formatted string. If it is a literal string, enclose it with quotation marks. Use the standard Message Formatting that are available for printf to set the format for the expressions you want to print.
exp 1, exp 2,.. exp nC Language | The expressions (variables) to be formatted and printed.
messageObject oriented | A string containing the message to send to the Output window. See and Java String Arguments.

The lr_message function sends a message to the log file and output window. When run in VuGen, the output file is output.txt.

Use lr_log_message instead of this function to send the message only to the log file. This conserves the network and controller resources required for sending messages to the output.

To send a message to the output file, you must enable logging in the runtime settings, and select Always send messages. If you select Send messages only when an error occurs, there is no output from this function. lr_set_debug_message calls can also affect the output.

In the log file, this function does not list the location and line number from where the message was issued. To issue a message with those details, use lr_output_message.

#### statement | #### Output
--- | ---
lr_message("a message") | a message
lr_output_message("a message"); | Action(4): a message

## Return Values

If this function succeeds, it returns the length of the message that was sent. If the function fails, it returns a negative number.

## Parameterization

You cannot use standard parameterization for any arguments in this function.

See Also

## Example

In the following example, lr_message sends a message if the connection to the server fails.

Copy code

    char* abort="aborting...";
    ...
    if (init() < 0) {
        <span style="font-weight: bold;">lr_message ("login failed: %s</span>"<span style="font-weight: bold;">, abort);}</span>
        return(0);
    }

Tips to improve your search results... VuGen Function Reference Version 26.1-26.3 Function Reference 26.1-26.3 All View Local Help Center View Online Help Center Version: