2006-09-07 09:01 PM
2006-09-08 09:33 PM
2006-09-08 10:02 PM
Peter wrote:C++ can use steps of course and more.
Hello Tom,
Does the C++ for loop have the "step" part like GDL ?
Peter Devlin
2006-09-08 10:29 PM
2006-09-08 10:50 PM
Peter wrote:Well. Some tests ( AC9 )
Hello Oleg,
Could you elaborate a little please.
How are they both not quite correct ?
Thank you,
Peter Devlin
counter = 0 bstep = 3 FOR dist=0 TO 3 STEP bstep counter = counter + 1 NEXT dist PRINT counterImagine there was some calculations.
counter = 0 bstep = 0.3/0.1 FOR dist=0 TO 3 STEP bstep counter = counter + 1 NEXT dist PRINT counterSame for WHILE
counter = 0 bstep = 0.3 dist = 0 WHILE dist < 0.3 DO dist = dist + bstep counter = counter + 1 ENDWHILE PRINT counter counter = 0 bstep = 1 - 0.7 dist = 0 WHILE dist < 0.3 DO dist = dist + bstep counter = counter + 1 ENDWHILE PRINT counterThe result will depend on actual values and calculations that's mean unstable.
2006-09-08 11:10 PM
2006-09-09 01:42 AM
2006-09-09 09:42 AM
2006-09-09 09:13 PM