[Coco] DEF USR and strings?

Allen Huffman alsplace at pobox.com
Wed Oct 29 18:01:06 EDT 2025


> On Oct 29, 2025, at 4:47 PM, William Astle via Coco <coco at maltedmedia.com> wrote:
> 
> My first thought was that maybe GIVABF didn't reset the value type to numeric but that's actually the first thing it does.
> 
> However, upon engaging my eyeballs and reading what you have there, you're trying to convert the string parameter you're passing to USR0 to a number with JSR INTCNV. That's clearly the wrong thing to do since a string isn't a number.

Ah, so there is a difference ROM call that has to be done for strings?

I see INTCNV immediately fails for a string:

INTCNV JSR LB143 ‘TM’ ERROR IF STRING VARIABLE

Duh.

I was expecting the call was detecting the variable type, and if string, returning the address of the string, versus a number, which would just be the number.

GIVABF and INTCNV are referenced in the EDTASM manual, but I just checked Disk EDTASM and neither seem they are not, there.

This may explain why I don’t know how to do this — the only thing documented was the one for passing in a number.

In the later version of “Getting Started with Extended BASIC” I see it describes only passing numbers. The example then shows using VARPTR() for passing strings.

Do you happen to know the name/label of a routine that gets the string address when using USRx()?

	— A


More information about the Coco mailing list