01-31-2015, 04:27 PM
This is peculiar to say the least:
I was trying to step around a circle, and could not get the STEP increment in a FOR loop to work for me. It worked as expected using other approaches. What's going on with the FOR's <STEP> increment?
-Dale-
Quote:EXPORT Test()
BEGIN
LOCAL angl;
print();
// FOR LOOP STEPS: pi/6"
FOR angl FROM 0 to pi STEP pi/6 DO
IF angl == pi/3 then
PRINT(" FOR LOOP is TRUE"); // Loop fails test ... bad dog!
END;
END;
// WHILE LOOP Increment pi/6
angl:=0;
WHILE angl <= pi DO
IF angl == pi/3 then
PRINT("WHILE LOOP is TRUE"); // Loop works!
END;
angl:=angl+pi/6; // Step increment pi/6
END;
END;
I was trying to step around a circle, and could not get the STEP increment in a FOR loop to work for me. It worked as expected using other approaches. What's going on with the FOR's <STEP> increment?
-Dale-