Post Reply 
Useful Programming Trick .. But 40 years late!
01-19-2016, 05:34 AM (This post was last modified: 01-19-2016 04:44 PM by Katie Wasserman.)
Post: #5
RE: Useful Programming Trick .. But 40 years late!
(01-19-2016 03:20 AM)Namir Wrote:  In 1983 I was using BASICA on the IBM PC. I wrote a per-processor program, which I called NBASIC, and published in in Dr Dobb's Journal. NBASIC read text files that had structured code with IF-THEN-ELSE, SELECT CASE, and SUBroutines (with parameters), and wrote BASICA-compliant code.

Neat! I see that you wrote a few articles for DDJ. I remember getting that journal way back in the late 1970's and reading about FORTH, tiny BASIC, etc.. It was so much more in depth than BYTE. But you really needed to get BYTE too if you wanted to keep up with what was going on with small computers back then.

BASICA does indeed have the same FOR-NEXT loop behavior that you show for the 71b and I used to use that feature too in many programs. However many other versions of BASIC from "back in the day" did not work this way. They worked by translating the FOR statement as a simple assignment statement, the increment-test-branch was done in the translation of the NEXT statement. This meant that FOR-NEXT loops were executed at least once no matter what the conditions.

The 1978 ANSI standard for minimal BASIC says FOR-NEXT loops should work as you use them in your trick, but many versions of BASIC came well before that and/or just didn't care to be compliant. This was true for Commodore BASIC for example.

-katie

Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Useful Programming Trick .. But 40 years late! - Katie Wasserman - 01-19-2016 05:34 AM



User(s) browsing this thread: 1 Guest(s)