On Apr 8, 9:27 pm, ArarghMail804NOS...@[EMAIL PROTECTED]
wrote:
> On Tue, 8 Apr 2008 11:20:03 -0700 (PDT), "R.Nicholson"
>
>
>
> <rhnlo...@[EMAIL PROTECTED]
> wrote:
> >On Apr 8, 1:45 am, ArarghMail804NOS...@[EMAIL PROTECTED]
wrote:
> >> On Tue, 8 Apr 2008 04:35:55 -0400, "Tom Lake" <tl...@[EMAIL PROTECTED]
>
> >> wrote:
> >...
> >> ><ArarghMail804NOS...@[EMAIL PROTECTED]
> wrote in message
> >> >news:ftvlv35geav069m24gptsieot401nno8uq@[EMAIL PROTECTED]
> >> >> On Mon, 7 Apr 2008 23:08:17 -0400, "Tom Lake" <tl...@[EMAIL PROTECTED]
>
> >> >> wrote:
> >> >> <snip>
> >> >>>CHR$(PEEK(SADD(a$))) turns that ASCII value back
> >> >>>into a character and so the letter T will print.
>
> >> >> Ok, I see where you are going.
>
> >> >> Won't work with PDS or VBDOS far strings, as those strings are not
in
> >> >> the "DEF SEG".
>
> >> >With SSEG it does. That's the beauty. It returns the address of
the string
> >> >as
> >> >an offset (near pointer) from the current data segment. SADD can
> >> >be used with both near and far strings. If the string is a far
string,
> >> >use the SSEG function to determine its segment.
>
> >> >a$ = "Test"
> >> >Segment = SSEG(a$)
> >> >Offset = SADD(a$)
> >> >DEF SEG = Segment
>
> >> >? CHR$(PEEK(SADD(a$)))
> >> >will still print "T" no matter if a$ is near or far.
>
> >> All very true, but wouldn't "LEFT$(a$,1)" still be a lot easier?
>
> >Not if you wanted to share read/write access to that string
> >with an assembly language routine (or an OS or library call
> >not available using the provided Basic syntax).
>
> Well, the proper way is to pass the string the normal way and use the
> (do***ented) basic runtime routines STRINGADDRESS & STRINGLENGTH to
> retrieve the address and length.
What 1980 versions of Basic have those do***ented runtime
routines? None that I remember. Maybe a 1986 version?


|