[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

Re: Clearsgts



Carl wrote:
6 millseconds to uninitialize them -- acceptable even by New York standards, I'd say.
As a New Yorker, I say it's acceptable because I call this routine only
upon exiting the program. I hate waiting for things to load or execute, but
I can tolerate 6 miliseconds (or 6 millseconds, for those who, unlike
Patrician and me, delight in catching typos) after I'm done with the program.

Carl also wrote:
But Harry still has a lot of explaining to do. Forty-four permanent
S/Gs!
Call it foresightedness. When I wrote XyBasic, I wanted to keep extra S/Gs
"reserved" for future expansion. Even in my longest XPL program, which is
14k, I actually use only 11.

Some of these S/Gs are for frequently-used constants. E.g.,

XyBasic source:  XPL
________________________
COMMA$        
ESC$           
CR.LF$         
SPACE$         
LFT_G$            three-byte version
RT_G$           three-byte version
That way I can blithely drop, say, COMMA into my source code in XyBasic without having to clutter up the source with a definition of COMMA$ each time.
The cases for which I especially need CLEARSGTS come when I use a literal.
This is a leftover from how Xy3 worked, which was all we had back when I
created XyBasic. In Xy3, if you wanted to test a S/G to see if it equalled
a literal (i.e., quoted) string, you first had to store that string in a
S/G. E.g. consider the XyBasic source code:

A$ = "xxx"
IF A$ = "xxx" THEN PRINT "Yes!"

In Xy3, XyBasic had to translate that into:

==>Yes!
I didn't want to use a low S/G like 02 (above) for this purpose, so I reserved 568-585 for temporary storage of literals, not realizing that there was a memory overhead to using S/Gs above 99.

Now, in Xy4 , we can just do the same task much more cleanly as:

=="xxx">yes
But I never adapted XyBasic to take advantage of that. And at this late date, I don't recall enough about how I wrote XyBasic to go in and make the changes necessary to have it deal with Xy4 syntax.
BTW, I don't understand why you and Robert are comparing the different
versions of uninitializing the 44 S/Gs with CLEARSGTS. What's wrong with:

JM 2.clearsgtsQ2


Harry Binswanger
hb@xxxxxxxx