MACROMEDIA COLDFUSION MX 7.0.2-USING COLDFUSION MX WITH FLEX 2 Guida Utente Pagina 203

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 256
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 202
Correct the coding error 203
Like the variables contained within the function, you can monitor the Text component’s text
property as you debug the application.
1. In the Variables view, select the txt_B text component (you may need to expand the this
icon) and expand it to display its properties (which of course are variables in this context).
Scroll down until you locate the
text variable and select it.
2. Right-click (Control-click on Macintosh) to display the context menu and select Watch
Variable.
3. Click the Expressions view and you’ll see that the variable is now in the watch list.
4. Resume debugging and use the Step Over command to execute each line of code. After the
line of code that is supposed to return the value of the conversion to dollars has been
executed, you’ll see that the text property of the text component has changed to ‘
NaN’. This
is the same incorrect result you got the first time you tested the application.
Correct the coding error
The coding error in the sample application occurs in the line of code that displays the value of
the calculation from euros to US dollars. Variable c was used instead of variable d.
The corrected line of code looks like this:
txt_B.text = String(d);
If you run the application now, the correct value will be displayed.
In this lesson, you learned the basics of debugging in Flex Builder. While debugging can be
complex, the debugging tools assist you inspecting your code and isolating the source of your
errors. To learn more, see Chapter 11, “Running and Debugging Applications” in Using Flex
Builder 2.
Vedere la pagina 202
1 2 ... 198 199 200 201 202 203 204 205 206 207 208 ... 255 256

Commenti su questo manuale

Nessun commento