LogMessage() function
- Last UpdatedJun 07, 2024
- 1 minute read
Writes a user-defined message to the Log Viewer.
Category
misc
Syntax
LogMessage("Message_Tag");
Parameter
Message_Tag
String to log to the Log Viewer. Actual string or message tagname.
Remarks
This is a very powerful function for troubleshooting InTouch scripting. By strategically placing LogMessage() functions in your scripts, you can determine the order of QuickScript execution, the performance of scripts, and identify the value of tags both before they are changed and after they have been affected by the QuickScript. Each message posted to the Log Viewer is stamped with the exact date and time.
Important: The percent (%) character formats diagnostic messages that appear in the Log Viewer while debugging scripts. WindowViewer can stop responding if the % character appears in a log string or a function parameter. To eliminate errors caused by %, use two %% characters.
Example(s)
LogMessage("Report Script is Running");
The above statement would print the following to the Log Viewer:
94/01/14 15:21:14 WWSCRIPT Message:Report Script is Running.
LogMessage("The Value of MyTag is " + Text(MyTag, "#"));
MyTag = MyTag + 10;
LogMessage("The Value of MyTag is " + Text(MyTag, "#"));