From: Brian McLaughlin
Subject: The joys of PB35
I recently got around to purchasing PB 3.5, and have been giving it
a test drive. I like all the new features, most especially the
ASCIIZ strings, arrays within TYPEs, and REDIM PRESERVE.
In the 3-4 years I've been using PB, I never found much use for flex
strings, or much understood them either, but within minutes I fell
in love with ASCIIZ strings. I will never again put an "ordinary"
fixed-length string into my programs, now that I can use ASCIIZ.
Their beauty is that all the string manipulation functions (INSTR,
MID$ and so on) accept them seamlessly, as if they were
variable-length strings, while preserving equal-length records in
arrays or files.
Also, since DOS services often require ASCIIZ strings, all my old
code that called such services had to kludge around that fact. Now,
it is much simpler to set things up properly.
REDIM PRESERVE has its legitimate purposes, too. For example, I
have some code that retrieves all the sub-directory names, for a
specific directory. In the past, I was forced to either count all
the directories ahead of time (and thrash the disk twice), or make
an array so big it could never be too small. That's a guessing game
you can always lose. And even then, there would be occasions when
that enormous array would pass back just one name, or choke because
it was returning all the directories on a massive disk.
With REDIM PRESERVE, the array can grow by leaps as it fills, then
shrink to the exact size needed when finished. I like that.
As for the heralded DIM VIRTUAL, for reasons I do not understand the
PB arrays are more than twice as slow as the EMS arrays in MAXLIB.
MAXLIB is a shareware product I wrote, now defunct, to use EMS/XMS.
I do not kid myself that this makes me a better programmer than Bob
Zale. But it does make me less impressed than I would otherwise be.
Brian M.
*** QwkNews (tm) v2.1
* [TN71] Toast House Import
--- GEcho 1.20/Pro
---------------
* Origin: Toast House Remote (1:100/561)
|