What my test program was to show, is that the WHILE/DO will only end the loop if the condition is not met when execution is on the WHILE/DO line (line 4).
In other words, the loop will not be ended when CTR>3, but rather when CTR>3 AND it is being checked by the WHILE/DO Line. I was testing that the loop would not just end on line 10 during the FIRST pass thru (when the condition became false CTR=4). Since the problem I was having was a loop that was justing ending between two statements, with neither statement being a conditional check, nor contained an EXIT, so the test program was just to prove to myself that WHILE/DO isn't some sort of overlord that monitors for the condition at all points within the loop and will end the loop immediately upon that condition not being met. So, the question still remains...wha happened? any why when I removed the WHILE/DO line did it stop happening? If I can gain any more meaningful information using RAID I will repost otherwise, it's just going to be one of those things.... But thank you for the responses of things to check into. George > -----Original Message----- > From: [email protected] [mailto:owner-u2- > [email protected]] On Behalf Of Nick Gettino > Sent: Friday, February 27, 2009 2:34 PM > To: [email protected] > Subject: RE: [U2] DO/WHILE vs IF THEN > > See below. > > Nicholas M Gettino | Director of Development | EnRoute Emergency > Systems, an Infor company | office: 813-207-6998 | fax: 678-393-5389 > [email protected] | www.enroute911.com > First time through... > Example: > > 0001: CTR=0 > 0002: LOOP First pass thru Second pass thru > 0003: CTR=CTR+1 CTR is 1 adds 1 to > CTR making it 8 > 0004: WHILE CTR<4 DO since CTR is NOW more > than 4 it stops > Read below. > 0005: PRINT CTR prints a 1 > 0006: CTR=CTR+1 adds 1 to CTR > 0007: PRINT CTR prints a 2 > 0008: CTR=CTR+1 adds 1 to CTR > 0009: PRINT CTR prints a 3 > 0010: CTR=CTR+1 adds 1 to CTR > 0011: PRINT CTR prints a 4 > 0012: CTR=CTR+1 adds 1 to CTR > 0013: PRINT CTR prints a 5 > 0014: CTR=CTR+1 adds 1 to CTR > 0015: PRINT CTR prints a 6 > 0016: CTR=CTR+1 adds 1 to CTR > 0017: PRINT CTR prints a 7 > 0018: REPEAT goes back to LOOP > 0019: STOP > 0020: END ------- u2-users mailing list [email protected] To unsubscribe please visit http://listserver.u2ug.org/
