Debug()

Evaluates any Control expressions and writes the result to stderr.

Synopsis

int Debug(expression[, expression[, ...]]);

Parameters

Parameter Meaning
expression Control function to be evaluated

Return Value

In the event of an error -1, otherwise 0.

Errors

Missing arguments

Description

Any Control expressions can be evaluated with the Debug() function. The result is output to the terminal from which the calling user interface or Control manager was started or to the Log viewer. Any number of arguments, separated by commas, can be processed, with each argument being output between square brackets '[ ]'.

You can suppress "DebugN()" entries that are still found in the scripts for the appropriate Manager with an entry "ignoreDebug = 1"; in the config file under [general], [ctrl], [ui] or [event]. If no entry is added to the config file, the DebugN()s are still output.

The _LINE_ constant can be used for outputting the current line number of the script. This constant is replaced by an integer constant in each script that contains the value of the current line number (e.g. DebugN("Zeile:", __LINE__);).

The format in which the Debug()s are output may vary for different WinCC OA versions. The function is used for troubleshooting in Control scripts!

Example

main()
{
  Debug("Hello world"); //Outputs the text
}

Assignment

Miscellaneous functions

Availability

UI, CTRL