Trace

SUMMARY

Trace - Switch on/off script tracing

SYNTAX

Trace(<on>)

ARGUMENTS

on (type:bool)
Trace(1) switches tracing on, Trace(0) switches tracing off

DESCRIPTION

If tracing is on, a trace file per BDC file is generated in the same folder, and with the same name as the BDC file but plus an extension .trace.html. The file may be viewed with any browser.

Tracing will always stop at the end of the script as if Trace(0) had been called.

As with all functions it is also possible to supply the value of an object or the return value of a function as argument of Trace() to enable conditional tracing.

If a script is too large and only a part if it is of interest, call Trace(1) to start tracing and later in the script Trace(0) to stop tracing.

If the script is within a figure, this will also be indicated in the file, but trace files will be generated for the displays where the figure is visible at runtime.

EXAMPLES

If a button in a display file MyDisplay.dis.xml has the following action script:

Trace(1);
If(IsEqual(OBJ.MyObj.String, "abc"))
{
  SetVal(OBJ.MyObj2.Value, 2);
}
			
Assuming that MyObj.String is "abc" a file MyDisplay.dis.xml.trace.html will be written with the following content:
Display "C:\vision\MyPrj\MyDisplay.dis.xml", button "MyButton"
Montag, 3. August 2009 13:57
IsEqual(anything "abc", anything "abc")
If(bool (NestedJob) 1)
SetVal(OBJ.MyObj2.Value, 2);
Assuming that MyObj.String is "def" a file MyDisplay.dis.xml.trace.html will be written with the following content:
Display "C:\vision\MyPrj\MyDisplay.dis.xml", button "MyButton"
Montag, 3. August 2009 13:58
IsEqual(anything "def", anything "abc")
If(bool (NestedJob) 0)
SetVal is not executed in this case.


Syntax Notation
[aaa]
aaa is optional (zero or one occurences)
(aaa|bbb)
aaa exclusive or bbb
(aaa)*
aaa may occur indefinitely often or may be omitted
(aaa)+
aaa may occur indefinitely often but at least once
(aaa)m..n
aaa may occur from m to n times