Re: DEF USR and strings?

Allen Huffman via Coco <coco-uNHYcr1XS/wmlAP/[email protected]>
Newsgroups gmane.comp.hardware.tandy.coco
Message-ID <[email protected]>
> On Oct 29, 2025, at 4:47 PM, William Astle via Coco <[email protected]> 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

-- 
Coco mailing list
[email protected]
https://pairlist5.pair.net/mailman/listinfo/coco
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.