158
Chapter 10 Debugging Application Code
HTML and CFML pages. For example, you can test the submittal of an HTML form
and its subsequent processing by a ColdFusion application page.
Stepping through code
To execute code in debug mode, you use these tools on the Debug toolbar:
•
Step Into
Proceeds to the next unit of execution in your code. Use this command
to step through code line-by-line.
If the next step is inside an included file or CFX, the debugger steps into the file.
•
Step Over
Same as Step Into, except that it executes included code but does not
trace through included code step-by-step. Does not step in included files
(CFINCLUDE, CFMODULE, or CFLOCATION) or custom tags.
•
Step Out
Steps back to the location in the original page where you entered
included code.
•
Run to Cursor
Executes to the cursor position; no breakpoint required. The
cursor location must be below the current position. If there are breakpoints
between the current position and the cursor, Run to Cursor stops at them.
Evaluating an expression and setting a watch
To evaluate an arbitrary expression, when the debugger is suspended at a
breakpoint, you use the evaluator box at the top of the Watches pane in the Debug
window. Use the evaluator when you want to know how an expression evaluates as
you step through code.
A watch lets you evaluate the same expression or variable each time you stop
execution. When you set a watch, the debugger evaluates the watched expression. If
the watched expression’s value changes, a hand icon displays.
You can use the evaluator to change values of variables, create new variables, or to
insert ColdFusion functions in your expressions.
To set a watch:
1
Select
Debug > Watches
or click Watches on the Debug toolbar. The Watches
pane displays.
2
Cut and paste an expression or variable into the list box at the top of the pane.
3
To find the value of the expression at the next breakpoint or line where the
Debugger stops, select Evaluate.
4
To add an expression in the evaluator list box to the list of watched expressions,
select Watch.
The Watch area shows the values of watched expressions and any error messages
in resolving these parameters.
5
To continue debugging, click Start/Continue.
6
Click End. Debugging stops.
Summary of Contents for HOMESITE
Page 11: ...Contents xi Table of CommandID values 310 Table of SettingID values 314 Glossary 323...
Page 12: ...xii Contents...
Page 20: ...xx About This Book...
Page 28: ...8 Chapter 1 Setting Up the Product...
Page 70: ...50 Chapter 4 Managing Files...
Page 88: ...68 Chapter 5 Writing Code and Web Content...
Page 116: ...96 Chapter 6 Editing Pages...
Page 148: ...128 Chapter 7 Using Web Development Languages...
Page 190: ...170 Chapter 11 Deploying Files...
Page 210: ...190 Chapter 12 Testing and Maintaining Web Pages...
Page 216: ...196 Chapter 13 Extending the Help System...
Page 350: ...330 Glossary...
Page 358: ...338 Index...