MACROMEDIA COLDFUSION MX 7.0.2-USING COLDFUSION MX WITH FLEX 2 Guide de l'utilisateur Page 202

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 256
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 201
202 Debug an Application
4. To begin debugging, you need to step into the function that is called by the button’s click
event. Select the Step Into command ( ) from the Debug view toolbar. The function is
highlighted in the code editor, as shown here:
Looking at the function you see that the troublesome section of code comes after the
else
if
statement, where the calculation from euros into US dollars occurs.
5. Click the Step Into command again to step into the function. To navigate to the else if
statement, click the Step Over command ( ). The Step Over command executes the
current line of code and then suspends on the next line of code.
6. Continue clicking the Step Over command to execute each line of code.
In the Variables view, the variables that are defined in the function are displayed. As each
line of code is executed their values are calculated and displayed, as shown here:
As you can see, the variable values are correct; multiplying 100 euros by the exchange rate
produces the correct value (the amount entered is stored in the variable b and the result of
the calculation is stored in variable d).
Stepping through and executing each line of your code helps you understand what is and
isnt working properly. In this case, since the values are correct, you can eliminate those
lines of code as the source of the error and explore other possibilities.
Watch a variable
Since the variables that store and calculate the data are correct, the next step is to examine the
line of code that displays the result of the calculation, shown here:
txt_B.text = String(c);
Vue de la page 201
1 2 ... 197 198 199 200 201 202 203 204 205 206 207 ... 255 256

Commentaires sur ces manuels

Pas de commentaire