3 Replies Latest reply: May 5, 2012 7:42 AM by GKaiseril RSS

    Could somebody see what is wrong that does not come to my eyes?

    JeffBPaarsa

      Hello,

       

      I can't see what is wrong with this code:

      I have eleminated excessive codes to make it easier to read... When this code is run I can see the first 3 dialog of app.alert but nothing after than... I can see p is not equal to nP... or at least I should have fallen one time into the do While loop? shouldn't I?  The red app.alert is not displayed why?

       

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

      var inch = 72;

      try
      {   nP = this.numPages;
          var p = 0;
          var x = 0.5;
          app.alert ('p='+ p);
          app.alert ('nP='+ nP);
          app.alert ('this.numPages='+ nP);
          do
            {
             switch (nP)
               {
                case 1:
                     {app.alert ('case 1 nP = '+ nP);
                     Add2LastPage();
                     p += 1;
                     break;}
                case nP > 1:
                     {app.alert ('case nP > 1 = '+ nP);
                     switch (p)
                        {
                         case 0:
                              {
                              x += 0.3;
                              p += 1;
                              break;}
                         default:
                              {
                              x += 0.3;

                              x += 0.3;

                              x += 0.3;

                              p += 1;
                              break;}
                        }
                     }
               }  
            }
          while (p != nP);
          Add2LastPage();
      }


      catch (e)
      {
      app.alert(e);
      }

      __________