[Coco] Color BASIC and "CURLIN" (direct versus in a program)

William Astle lost at l-w.ca
Fri Oct 24 15:14:57 EDT 2025


On 2025-10-24 13:01, Allen Huffman via Coco wrote:
>> On Oct 24, 2025, at 1:56 PM, William Astle via Coco <coco at maltedmedia.com> wrote:
>>
>> You can theoretically intercept PRINT but it's truly miserable to do if you need to do anything on actual character output. But you might be able to intercept PRINT, set a flag, and then intercept the command interpretation loop to reset the flag before command dispatch. That's a bit weird to accomplish, but it's doable.
>>
>> You can check how Extended Basic intercepts CLOADM or how Disk Basic intercepts PMODE to figure out how you might set a flag based on whether PRINT is running.
> 
> Thanks — I’ll look at those for examples.
> 
> I was trying to find out how it knows what token was just parsed, but the code is fancier than my brain can currently understand.

I believe you'll want to look at the "Command interpretation loop" 
(RVEC20) and the "Crunch" (RVEC23) handlers. Yes, really. The 
tokenization routine. It's a hack to work around some unfortunate 
weirdness in the structure of Basic's main loop. Incidentally, Disk 
Basic 1.1 completely replaces the entire command interpretation main 
loop in its handler, apparently needlessly (it has a reason but it's not 
really important). I mention that so you can avoid being confused about 
what it's doing.


More information about the Coco mailing list