[Coco] MC-10/CoCo BASIC - why did I code this way?

Allen Huffman alsplace at pobox.com
Thu Dec 28 14:26:32 EST 2017


I was working on a text adventure called The Oddyssey. It was being coded so it could run on a CoCo or an MC-10. 

I found the program, and it was all mapped out with commands and such, just waiting for objects and descriptions.

But I see weird things in the code. I load up arrays manually, like this:

100 NM$(0)=“aaa”:NM$(1)=“xxx”:NM$(2)=“yyy”

I know there were some Extended Color BASIC commands the MC-10 didn’t have, so we were making sure to only use things available on the MC-10.

I thought maybe the MC-10 didn’t have READ/DATA, or couldn’t READ in to arrays. Using the online www.mc-10.com emulator, I saw it does support that.

So why would I chose to do it manually? I assume this is a faster way to load the variables than READ/DATA, but I wonder if there was more.

My thought:

I knew strings could live in program code, or in string memory. Perhaps I did NOT know that strings could print IN to code, and assumed:

10 READ A$
20 DATA “THIS IS A STRING”

...would result in “THIS IS A STRING” being in the program space, PLUS a copy in string memory.

That’s the only thing I can think of.

Was there any other reason why someone would EVER manually load an array in BASIC like that? Seems awfully inefficient to me, now, and would have back then since I was well aware of READ/DATA.

Thoughts?

		— A




More information about the Coco mailing list