[Color Computer] [Coco] Bug in FOR NEXT ?
Roger Taylor
webmaster at coco3.com
Sat Jun 3 18:00:31 EDT 2006
At 04:21 PM 6/3/2006, you wrote:
>On Jun 2, 2006, at 11:23 PM, Willard Goosey wrote:
>
>>That's a Pascal-ism, actually.
>>
>>The thing that surprised ME when I ran across it in BASIC is that
>>FOR-NEXT loops always go through the loop at least once, even in cases
>>like:
>>10 A=0
>>20 FOR B=1 TO A
>>30 REM DO SOMETHING
>>40 NEXT B
>>
>>Willard
>
>Not really surprising considering that you can either test at the
>bottom or at the top and testing at the bottom creates an
>unconditional branch at the bottom of the loop.
<scratching noggin>
Actually, I think that wherever the test is done (top of bottom) is where
the *conditional* branch is placed, so testing at the bottom would create a
conditional branch at the bottom, no?
</scratching noggin>
--
Roger Taylor
More information about the Coco
mailing list