OverviewExamples
Debug.Print("Readme button clicked");
Prints "Readme button clicked" to the debug window. (You could put this action in the "On Click" event for a readme button to find out if the event's actions are being performed.)
Debug.Print("Mouse over event fired: " .. Debug.GetEventContext());
Prints a debug message consisting of the string ""Mouse over event fired: " followed by the current event context.
Debug.Print("Jumping from page "..page_num.." to page "..next_page_num);
Prints a debug message to log a page jump. Note the use of concatenation operators (..) to include the contents of two variables ("page_num" and "next_page_num") in the message.
-- Show the debug window.
Debug.ShowWindow(true);
-- Turn on the debug trace mode.
Debug.SetTraceMode(true);
-- Print some example text to the debug window.
Debug.Print("This is a test line that will be printed.\r\n");
-- Perform some addition and write it out to the debug window.
total = 6 + 2;
Debug.Print(total.."\r\n");
-- Print the current date to the debug window.
Debug.Print(System.GetDate(DATE_FMT_ISO).."\r\n");
-- Get the event context and print it to the debug window.
context = Debug.GetEventContext();
Debug.Print(context);
-- Determine if trace mode is turned on and print the result to the debug window.
trace_mode = Debug.GetTraceMode();
if trace_mode then
Debug.Print("Trace mode is on.\r\n");
else
Debug.Print("Trace mode is off.\r\n");
end
This example uses a few of the debug actions to output content to the debug window.
Tip: Create a label object and copy this script into one of its events to see how it works.
See also: Related Actions