Stepping Through Your Code; Exercise: Calculator - Adobe 12001196 - Acrobat - Mac Manual

Javascript
Hide thumbs Also See for 12001196 - Acrobat - Mac:
Table of Contents

Advertisement

Stepping Through Your Code

The Acrobat JavaScript Debugger allows you to easily control what portions of the script
you want to see executed. Four of the toolbar buttons allow you to step through your code
when a script is stopped in the debugger. These are the
Step
Buttons" on page
the debugger.
When the line you have stopped contains a call to a JavaScript function, you may wish to
execute the individual statements inside that function by clicking on the Step Into button
on the toolbar. This is called stepping into a function and allows you to investigate exactly
what is going on with your script when a function is called. Be aware that native functions,
for which there is no JavaScript implementation, will not allow you to step into them.
When the line you have stopped contains a function call, you may avoid executing the
individual statements in that function by clicking on the Step Over button on the toolbar
This is called stepping over a function. If the statement you have stopped does not contain
a function call, stepping over will simply execute that statement.
If the line you are stopped at is inside a function call, you may choose not to step through
the rest of the statements of that function by clicking the Step Out button on the toolbar.
This is called stepping out of a function and allows you to return to the statement which
called that function. If you are not inside a function call, clicking on the Step Out button will
continue execution to the end of the script or until a breakpoint is reached.
When stopped in the debugger, you may continue execution from the current statement
by clicking on the Resume Execution button on the toolbar. Your program will either run
to completion or stop again if it reaches a new breakpoint.

Exercise: Calculator

To do the following exercises, you must have unzipped the file
Calc.pdf file.
In this exercise, you will set breakpoints in a script and create watches to view how a
variable changes as you execute the script in the debugger. At the end of this exercise you
will be able to:
Start the debugger from a location within a script.
Interpret the contents of the Inspect details window.
Create, edit, and delete watches.
Set and clear breakpoints.
Use these debugger buttons to control how the interpreter executes the code in the
script.
Acrobat JavaScript Scripting Guide
Into, and
Step Out
buttons, described individually in the section on
37. This section describes how the buttons are used together to control
Acrobat JavaScript Debugger
Stepping Through Your Code
Resume
Execution,
Step
"Debugger
TestDebugger.zip
3
Over,
. to get the
47

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Acrobat 6.0

Table of Contents