I am not sure i understand your problem fully Matteo but i tried the
following code with a break point on > var bob = 1;
and it stopped there every time. i.e. your code seems to work fine

var cminutes = 5;
var startminutes = 2;
function elapseddistance()  {
    if ((cminutes) > (startminutes-1)) {
      //do something i know it's working
      var bob =1;
    }
    var t;
    t=setTimeout("elapseddistance()",100);
  }

// Main
function load() {
   elapseddistance();
}

On Dec 27, 10:39 am, tzenobite <[email protected]> wrote:
> and i can't figure out why :(
>
> i got this really simple loop:
>
> function elapseddistance()
> {
> if ((cminutes) > (startminutes-1)) {
>
> //do something i know it's working
>   }
>   var t;
>   t=setTimeout("elapseddistance()",100);
>
> }
>
> the loop take the actual time (cminutes) as minutes, calculated
> elsewhere, and the theoric start time as minutes (calculated elsewhere
> too), both as global variables
> i got spy fields, so i can see that cminutes IS more than
> startminutes, but if i try the loop without the if trap it works, with
> the trap it didn't work despite of any value of cminutes and
> startminutes
> i fear this will be a really stupid error, but i'm coding for two
> days, maybe i'm not as awaken as i need to be ;-)
>
> many many thanks!
> matteo

--

You received this message because you are subscribed to the Google Groups 
"iPhoneWebDev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/iphonewebdev?hl=en.


Reply via email to