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

Bill Gunshannon bill.gunshannon at hotmail.com
Thu Dec 28 17:51:27 EST 2017


Interesting, I thought I remembered doing it in the past and I looked
it up in my handy, dandy "TRS-80 Computer Reference Handbook",
cat No. 62-2314 and it specifically listed it as a use for the DEL verb.

"or to delete program lines 'dynamically' to release portions of BASIC
programs that are no longer needed to create room for variables."

But, I tried it on a COCO3 with ECB and on a Level II Model I and it,
in fact, did not work.

bill

________________________________
From: Coco <coco-bounces at maltedmedia.com> on behalf of Allen Huffman <alsplace at pobox.com>
Sent: Thursday, December 28, 2017 2:55 PM
To: CoCoList for Color Computer Enthusiasts
Subject: Re: [Coco] MC-10/CoCo BASIC - why did I code this way?

> Don't know why someone would do that.
> It is really easy to write your program so that the DATA does not reside
> in program and string space when run.
> 10 DATA  "A","B","C"
> 20 READ A$,B$,C$
> 30 PRINT A$,B$,C$
> 40 DEL 10
> 50 PRINT A$,B$,C$
> 99 END

This code snippet suddenly made me realize that BASIC would have to check, when using DEL, to see if any strings were in code space. If so, it would have to relocate them. I then thought about all the ways you could make programs init, delete that code, then continue with more RAM for strings and such.

But, it doesn’t look like it works. In a test I just tried, as soon as it hits the DEL, the program stops running.

That would have been cool, though.

                — Allen



--
Coco mailing list
Coco at maltedmedia.com
https://pairlist5.pair.net/mailman/listinfo/coco


More information about the Coco mailing list