Share this page

# lr.message

Sends a message to the log and output window.

## C#

    void lr.message( string message );

## VB.NET

    Sub lr.message( ByVal message  As String )

Message Functions

## Arguments

Name | Comments
--- | ---
message | The string to log.

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.

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

No value returned.

## Parameterization

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

## Example

The following example sends a message to the output if the login fails.

Copy code

    public int login(string username, string password)
    {
    //emulate failed login
    return lr.FAIL;
    }
    int status = login("username","password");

    if (status == lr.FAIL) {
      string strOutputMsg="Error: Unable to login to server";
     lr.message(strOutputMsg);
    }

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: