MACROMEDIA COLDFUSION 5 - CFML Bedienungsanleitung Seite 6

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 11
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 5
than putting in
CFDUMP
s or
CFOUTPUT
s, and having to remember to remove them? As I discuss
in the sidebar, there are also situations where you simply can’t use
CFDUMP
or
CFOUTPUT
.
If you had a large number of variables, exploring this Variables view would be tedious.
Another option is to set a number of watched expressions. This is more like using old-style
outputs, except they never send output to the browser; instead, the results are shown
inside the debugger. With this Expressions panel, you can choose to watch any variable or
expression. (An expression can be anything you might put on the right side of the =” of a
CFSET
, or in a
CFIF
condition, including variables, functions, and so on.) Here’s an example that
shows a few:
You can enter expressions
by right-clicking in
the Expressions View,
selecting Add Watch
Expression, and typing in
the expression manually.
Unlike FusionDebug,
you cannot highlight an
expression in the code
editor, and right-click and
select Watch Expression. And though the CF8 debugger won’t show a
Set
Variable option
when you right-click such a variable within code, you can indeed right-click on a variable
in either the variables or expressions pages in order to set that variable on the y to a new
value while debugging an application.
Stepping Through Lines of Code
While it is useful to stop at one point in the program and view all of the above, the ability
to step through your code is one of the debugger’s most important and fundamental
features.
Consider again the code in Figure 1, where we were stopped on line 4. How would we tell
the debugger to proceed? Notice the icons at the top of the Debug pane of the debugger
interface:
These icons tell the program
whether and how to continue
executing code. The Step
Over button selected in
Figure 4 is perhaps the most
commonly used, though the
one to the left of it is Step Into,
which is discussed later. When
you select Step Over, the debugger simply executes the next line of code (line 6 in Figure 1).
All the examples so far have talked about things you can do while stopped at a breakpoint.
These apply to code you’ve reached by stepping through code as well.
Understanding the Stack Trace
The Debug pane also presents a representation of the stack trace for a current request,
which is especially helpful when the line being executed is embedded deep within a multi-
Figure 3: Expressions view
Figure 4: Debug pane
92 Tools The Fusion Authority Quarterly Update
Seitenansicht 5
1 2 3 4 5 6 7 8 9 10 11

Kommentare zu diesen Handbüchern

Keine Kommentare