[Coco] BASIC program crashing Xroar emulator?

Allen Huffman alsplace at pobox.com
Thu Feb 27 12:51:48 EST 2025


> On Feb 27, 2025, at 11:44 AM, William Astle via Coco <coco at maltedmedia.com> wrote:
> 
> The only solution as far as I can tell is do no output on the 40/80 column screen or clear less string space.

Do we (you :) know what the max amount of string space you can clear is? I will check Unravelled, as I expect they discuss this somewhere.

> Given that a lot of the numbers used for CLEAR for string space are effectively random with no real understanding of how big they need to be, it's entirely possible that 17000 is way more than it needs to be. Something most programmers don't know is that a string constant in the program that is never modified doesn't use up any string space so often the CLEAR number is massively larger than it needs to be.

When I wrote my ALLRAM BBS, I had learned you DIM every variable up front to allocate it then and then I calculated worst case if every line of every message and every userlog entry was as full as possible — to avoid a crash by someone just filling up all the message buffers.

But for this program, I am sure this was arbitrary. The function was to read an index file and display a list of articles with a key that is used to select it, then it will OPEN that file and load it into an array so it can display a page at a time with keys to scroll up and down. I find some huge (obviously program-generated) test .txt files I made (hundreds of lines).

I bet one of my RS-DOS disk images has this program and maybe a later version that did not crash. I just don’t know why i would have saved a crashing version at all.

This crash being the case, my ALLRAM BBS could never work in 40 columns on a CoCo 3;-) I guess I never tried!

Thank you for the insight, as always!

> Having the WIDTH before the CLEAR should prevent WIDTH from crashing but any subsequent PRINT, LOCATE, INPUT (from keyboard), or HSTAT probably would crash.

That is quite a bit limiting :)

		— A


More information about the Coco mailing list