1 Reply Latest reply on Nov 29, 2010 5:13 AM by pguerett

    Global variable use

    HyungSikKIM

      Dear All.

       

      I set Global variable up in the Init as attached file.

       

      variables.JPG

      --------------------------------- Code ---------------------------------

      var total = 0;

      .

      .

      .

      .

      function Xxx(){

      total = total + 10

      app.alert(total);     // =====> 10

      }

       

      ---------------------------------------------------------------------------

       

      when i call Xxx(), Xxx() function alert 10;

      in click event of button on the next page, i tried to call total variable(Global variable).

       

      --------------------------------- Code ---------------------------------

       

      app.alert(total);       // =====> error?

       

      app.alert(Init.total);  // =====> 0

       

      ---------------------------------------------------------------------------

       

      How can i use Global variable?