1 Reply Latest reply on Mar 16, 2016 8:58 AM by Mylenium

    How to time multiple expressions?

      I understand how to time two expressions with:

       

      if (time < 1){
           //expression x here
      }
      else{
           //expression y here
      }
      

       

      But what if I have many more expressions and want them to execute if between specific times, for example I tried:

       

      if(time = 1,2){
           //expression x here
      }
      else if (time = 3,4){
           //expression y here
      }
      
      else if (time = 5,6){
           //expression z here
      }
      
      


      But that didn't work. Help very much appreciated~

        • 1. Re: How to time multiple expressions?
          Mylenium Most Valuable Participant

          Well, you might want to read up on how JavaScript works on a quite general level. Your code just completely makes no sense at all.

           

          • in programming the point is the numeric delimiter, not the comma
          • = is an assignment operator, not a logic operator
          • a segment has a start and a beginning, but you are only defining a specific exact time in your conditionals
          • you have no fallback else{}

           

          Based on all that, you have to completely rewrite it. Example:

           

          if (time >= 0 && time < 1){}

          else if (time >=1 && time < 2.3){}

          else{}

           

          Mylenium