Our World Statistics Day conversations have been a great reminder of how much statistics can inform our lives. Do you have an example of how statistics has made a difference in your life? Share your story with the Community!
Choose Language Hide Translation Bar
Highlighted
whom
Level I

Loop isn't working. Help!

Ok, I'm stumped and getting a bit annoyed... I have a JMP file (DT2) with 167 records. MaxOrigRows does get set to 167. However, the FOR loop goes into an infinite loop. Inside the loop, the value of MaxOrigRows IS 167, but the variable "i" was going past 60,000 when I was able to finally stop. Can anyone see anything wrong?



MaxOrigRows = NRow(Dt2);
Show (MaxOrigRows);

For (i=1,MaxOrigRows, i++,
Show(i,MaxOrigRows);
);
2 REPLIES 2
Highlighted
whom
Level I

Re: Loop isn't working. Help!

ah... nevermind.. the limit variable wasn't correct... I was getting mixed up with the FOR loop construct for another language, and omitted the " i <=" part. HA!

For (i=1, i<=MaxOrigRows, i++,
Show(i,MaxOrigRows);
);
Highlighted
whom
Level I

Re: Loop isn't working. Help!

sorry, should have been "i less than or equal to MaxOrigRows"

I think the Less Than Sign messed up the formatting.
Article Labels

    There are no labels assigned to this post.