Share this page

# lr.message

Sends a message to the log and output window.

    int lr.message( String message );

Message Functions | Java Syntax

## 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.

## Examples

### Example 1 - Printing a Simple Message

    lr.message("Accessing Talk Forum ORB...");

### Example 2 - Printing Strings, Longs, and Other Data Types

    String str = "Test";
    long lg = 100;
    lr.message("The value of str = " + str + ".");
    lr.message("The value of lg is " + lg + "." );

### Example3 - Printing Output of a Function Call

    lr.message("Chat Population = " + orChatForum.count() );

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