2019.2

Table Of Contents
Tip
When you click on an identifier (such as a variable name) in a script, the overview ruler at
the right highlights all other occurrences of that identifier straightaway.
Variables
At the bottom right the Script Debugger shows a hierarchical overview of all variables in the
scope chain and their state. This information is always relative to the current stack frame, which
is the one that's selected on the left.
The overview includes the special entry "(this)", which represents the JavaScript "this" object.
If the current script is not a Control Script, the overview also includes the special entry "
(resource)". When expanded, this entry shows the HTML of the current Master Page or section,
allowing you to see exactly how each line in the script affects the DOM.
Use the Copy button (or press Ctrl+C) to copy the label and contents of the selected variable
and all of its children to the clipboard.
Expressions
You can add custom expressions at the top of the list of variables. This is especially useful
when you want to monitor the value of a variable that is situated at a lower level in the
hierarchy. For example, if you'd want to directly see the height of the top margin of a section as
you step through the code, you could add the following expression:
merge.section.margins.top.
Expressions can include function calls. For example, you could monitor the height of an
element that has the ID my_div with the expression: query("#my_div").height(). Note that the
query in this example will be limited to the current resource (Master Page or section).
You could also change the value of a variable through an expression to see how that affects the
document. Let's suppose execution is suspended before an if-statement: if (foo == 3). If foo
is not equal to 3, but you'd still like to see what would happen if it were, you could add the
expression foo = 3.
Expressions are evaluated automatically when execution is suspended.
l
The Add button lets you add an expression to the overview. Expressions must be unique
and cannot be empty; empty expressions will be removed.
l
To edit an existing expression, just click the entry.
l
The Delete button removes the selected expression.
Page 972