The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
FOR LOOP "STEP" ?
01-31-2015, 04:27 PM
Post: #1
FOR LOOP "STEP" ?
This is peculiar to say the least:

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-
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
FOR LOOP "STEP" ? - DrD - 01-31-2015 04:27 PM
RE: FOR LOOP "STEP" ? - Dieter - 01-31-2015, 06:50 PM



User(s) browsing this thread: 1 Guest(s)