[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Advanced Programming Structures
- Subject: Advanced Programming Structures
- From: "Keith Olson" <s p a m t r a p 0 0 7 @ y a h o o . c o m>
- Date: Tue, 3 Jul 2001 02:52:32 -0700
- Newsgroups: comp.sys.atari.8bit, comp.sys.apple2
- Organization: Posted via Supernews, http://www.supernews.com
- Xref: archiver1.google.com comp.sys.atari.8bit:6432 comp.sys.apple2:9894
Hi gang! I just came across a few notes from a programming class that I
taught a decade or so ago. Check this out:
DO
.
.
.
LOOP UNTIL X<>0
is the same as
FOR II = 0 TO 1
.
.
.
II=1
IF X=0 THEN II=0
IF Y=0 THEN II=9
IF Y=99 THEN II=10
NEXT II
IF II=10 THEN PRINT "AT BOTTOM"
IF II=11 THEN PRINT "AT TOP"
Neat, eh? A controlled loop w/o any GOTOs needed *AND* exit codes to boot!
--
Keith Olson
---------------------------------------------------------------------
| For the memory of the uncompromisingly righteous is a blessing, |
| Proverbs 10:7a |
---------------------------------------------------------------------