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
My first thought was that once CTR = 5, the loop would end (at LINE 12)
but
it
didn't
until control was passed back to LINE 4, then it ended.
[Nick] Should have been written.
CTR=0
LOOP WHILE CTR < 4 DO
CTR = CTR + 1
REPEAT
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/