[Coco] MC-10/CoCo BASIC - why did I code this way?
Allen Huffman
alsplace at pobox.com
Thu Dec 28 14:55:04 EST 2017
> 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
More information about the Coco
mailing list