This statement is typically used to display a debug panel, possibly conditionally. You can also use it set the action debug state to true or false. When setting the action debug state a debug panel is not displayed.
You can configure under what conditions a debug panel is displayed. The choices are Always or only if the action debug state or action test state is true or false. More information can be found in Debugging Actions.
A displayed debug panel is used to debug actions. You can optionally specify a message to be displayed at the top of the panel. You can use simple markup sequences in the prompt text specifying colours, bold and italic. The markup sequences are described in Common Prompt Markup Functionality. The supplied prompt string may contain any of the escape sequences described in Escape Sequences.
What additional content is displayed is configured at runtime. This content includes things such as the contents of named and track variables and much more. When a debug panel is displayed there is a Configure button which provides access to the content configuration panel. The configuration panel is described in Debug Content Configuration.
The Configure button has a disclosure control which displays a menu with various runtime functions. The runtime functions are described in The Debug Panel.
You can elect to issue a beep with the prompt.
The Log option is only meaningful whan batch processing. If Log is specified, the results will be written to the Batch Processor's log file as opposed to being displayed in the Action Pending Window.
Much of the power of the Debug statement comes from its ability to conditionally display based on the value of the action debug state or the action test state. The action debug state is similar to the action test state with the exception that it is only used by the Debug statement. Using this capability, you can place Debug statements which only display under certain conditions. While you can conditionally display based on the value of the action test state it is often preferable to use the action debug state as the flow of your action will not be modified while debugging.
In the simplest usage model you place one or more unconditional (Always) Debug statements and one or more conditional ones testing the action debug state. When an unconditional Debug statement is encountered you can choose to continue action execution and set the action debug state to true or false. In this manner you can control the display of the conditional Debug statements.
More sophisticated triggers can be enabled by using compare statements in conjunction with the Debug Statement. The Compare Date, Compare Numeric and Compare Text statements all have a Debug setting. When Debug is enabled, the statements modify the action debug state as opposed to the action test state. This enables the construction of complicated test conditions which can be evaluated by a Debug statement and which do not change the action's designed flow.
When one of the compare statements has the Debug option enabled, it is treated as a debug statement. It will display with red text in an action editor window. This is done so that it is obvious that they are present for debugging purposes. The statements will also be located when searching for debug statements. The three compare statements which support the Debug setting are the only action statements which can modify the debug action state. The only other way of changing the debug action state is from a displayed debug panel.
The folowing example will only display the debug panel if named variable test has a value of abc:
Test if named variable 'test' is equal to "abc" (Set debug state)
Debug only if the action debug state is true
While the If statement cannot test the debug state you can use a Compare Numeric statement with text as the source to do so.
Test if text "\?ds" is true (Set test state)