JavaScript Functions > Alphabetical Listing of Utility Functions (lr) > lr.message

lr.message

Sends a message to the log and output window.

Example Message Functions

Syntax

lr.message( message );

Arguments

Argument Comments
message The message to send to the Output window.

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.logMessage 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 run-time settings, and select Always send messages. If you select Send messages only when an error occurs, there is no output from this function. lr.setDebugMessage 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.outputMessage.

statement

Output

lr.message("a message") a message
lr.outputMessage("a message"); action(4): a message

Return Values

On success, returns the length of the message that was sent. On failure, returns a negative number.

Parameterization

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

Concept Link IconSee Also

Example

function Action(){

   if (init() < 0) {
       lr.message ("login failed abort");
       return(0);
   }

   return 0;
}