On Tue, 08 Apr 2008 03:29:05 -0500, "Stephen J. Rush"
<sjrush@[EMAIL PROTECTED]
> wrote:
>On Tue, 08 Apr 2008 00:21:08 -0500, ArarghMail804NOSPAM wrote:
>
<snip>
>> Won't work with PDS or VBDOS far strings, as those strings are not in
>> the "DEF SEG".
<snip>
>I couldn't afford PDS, but I'm sure it used string descriptors and had
>functions that worked like and VARPTR, VARSEG and SADD. Some of the
>things we used to use string variables for weren't really strings. On
>the TRS-80 and CP/M systems, we used to build custom functions by packing
>machine code into a string and using VARPTR to find its address. Before
>the coming of Windows, when video RAM ocntained ASCII data, you could
>POKE values into a string's descriptor to make that variable point to a
>field on the screen. You can twiddle with descriptors to quickly swap
>the values of two large string variables. Since a string descriptor
>contains a pointer, you can use it to get around QuickBasic's lack of
>pointer variables to do many of the tricks that C allows (including
>shooting yourself in the foot).
The problem with most of these tricks is (at least in MS 16-bit
basics) that there are backpointers in the string pool, and that
during the next pool compaction you may wind up with a 'String Pool
Corrupt' error. In any case, they aren't needed except for QBasic,
which doesn't sup****t QLBs.
However, you can point an array descriptor to the text video memory
and get direct video access that way. I haven't ever actually done
that, as LONG ago I wrote my own text display routines that write
directly to video memory. They are many times faster than an ordinary
PRINT statement.
--
ArarghMail804 at [drop the 'http://www.'
from ->] http://www.arargh.com
BCET Basic Compiler Page: http://www.arargh.com/basic/index.html
To reply by email, remove the extra stuff from the reply address.


|