IonicWind Software

Aurora Compiler => General Discussion => Topic started by: Parker on January 08, 2006, 04:48:30 PM

Title: The FOR loop
Post by: Parker on January 08, 2006, 04:48:30 PM
While converting some code, I'm wondering how exactly the FOR loop in Aurora compares to a BASIC-style one. We have the syntax for(assignment; comparison; assignment) which makes a lot more sense to me how it actually works, since you can make i < 20, <=, or whatever you want. But I'm just wondering, how exactly is this translated:
FOR i = 0 TO 20
Does that mean that i goes up through 20, or that it stops right before 20, in which case I would write
for (i = 0; i < 20; i++) {
Title: Re: The FOR loop
Post by: Ionic Wind Support Team on January 08, 2006, 05:23:51 PM
In BASIC it includes the last number in the loop so FOR x=0 to 20 will do 21 iterations.
Title: Re: The FOR loop
Post by: Parker on January 08, 2006, 05:50:45 PM
Thanks, I've always wondered about that, now I'm sure.