[Color Computer] Re: [Coco] Bug in FOR NEXT ?
James the Animal Tamer
emucompboy at yahoo.com
Fri Jun 2 17:37:59 EDT 2006
I think all the Microsoft 2 BASICs did that, and probably a lot of
others as well.
If I remember correctly, and I probably don't, the FOR-NEXT loop
would do one iteration even if the condition were false at the
outset -- something to watch out for.
Been too long since I've written a program in BASIC and paid
attention to such matters. Mostly I write programs to try to figure
out how the hardware of old computers works.
--- In ColorComputer at yahoogroups.com, "James Diffendaffer"
<jdiffendaffer at ...> wrote:
>
> Congratulations... you just discovered the most common test question
> from any BASIC programming class.
> It would list a program like that and ask what the output was.
> In other words... that's not unique to the Coco.
>
> >I can't believe that after +20 years with the CoCo I never got
into
> >this... weird.
> >Thanks
> >
> >
> >Benoit Bleau wrote:
> >
> >>>
> >> Diego,
> >> That's not a bug... In (at least the coco) basic, the "for-next"
> >> variable contains +1 at the end of the loop.
> >> Try this:
> >> 10 FOR A=1 to 10: NEXT
> >> 20 PRINT A
> >>
> >> This should print 11.
>
------------------------ Yahoo! Groups Sponsor --------------------~-->
Everything you need is one click away. Make Yahoo! your home page now.
http://us.click.yahoo.com/AHchtC/4FxNAA/yQLSAA/CFFolB/TM
--------------------------------------------------------------------~->
Brought to you by the 6809, the 6803 and their cousins!
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ColorComputer/
<*> To unsubscribe from this group, send an email to:
ColorComputer-unsubscribe at yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
More information about the Coco
mailing list