[Color Computer] [Coco] Bug in FOR NEXT ?

Willard Goosey goosey at virgo.sdc.org
Sun Jun 4 04:14:01 EDT 2006


>Date: Sat, 3 Jun 2006 06:31:31 -0400
>From: "Kenneth Schunk" <ken.schunk at gmail.com>
>
>> 10 A=0
>> 20 FOR B=1 TO A
>> 30 REM DO SOMETHING
>> 40 NEXT B

>Yes, it's not obvious that the test is made in the NEXT statement, not
>in the FOR statement. That's caught quite a few people. The Pascal
>"Repeat ... Until" and "While" statements make it a bit more obvious
>where the test is going to occur.

True.  And it was really laziness that led me to it, anyway.  Under
Pascal I wouldn't try that.  I'd explicity do something like if a > 1
then for....

In C it would be for(b=1; b<a; b++)... which might be what I was
thinking of.

Willard
-- 
Willard Goosey  goosey at sdc.org
Socorro, New Mexico, USA
"I've never been to Contempt!  Isn't that somewhere in New Mexico?"
   --- Yacko



More information about the Coco mailing list