Re: Saving the text screen into strings???

Patrick Ulland via Coco <[email protected]> Fri, 1 May 2026 06:20:37 -0500
Newsgroups gmane.comp.hardware.tandy.coco
Message-ID <[email protected]>
On 4/30/2026 10:13 PM, Allen Huffman via Coco wrote:
> In the TRS-80 MC-10 Facebook group, Jim Gerrie posted some code he was 
> trying to convert to the MC-10. It came from (I think) a TRS-80 (Model 
> I or III or whatever?).
>
> What it did was make a temporary string, like
>
> A$=“”
>
Allen! Always enjoy your exploits.

Sort of related, if you are porting from ZX81 BASIC the original program 
might include a mystery line like 10 LET A$=”” where A$ is never 
referenced anyplace else in the program.

This is a workaround replacing(ish) CLEAR, READ, DATA, and WRITE to 
tape. The trick being ZX81 BASIC starts each line with a 2 byte number 
and a 2 byte length. To CLEAR space declare a line say 8K long, and copy 
the rest of the program above that.

Why? If you don’t touch A$, the line containing A$ is never actually 
parsed, but it IS part of the BASIC listing. So build the dataset as you 
will and Viola! Saving the program to tape also saves the data.

A minute of WTF averted? As always, extracted from a very old archive 
(me) so it’s worth checking the numbers.

-rick

-- 
Coco mailing list
[email protected]
http://listserv.adelphi.edu/cgi-bin/mailman/listinfo/coco