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

Re: Parse



** Reply to message from Harry Binswanger  on Thu, 23 Jan 2003
22:56:58 -0500


> >Transient Save/Gets only, of course (range
> >01-99) -- you have to fill out fifteen forms to get permission to use a
> >Permanent Save/Get 100-1999, and even then, may be denied.

> Sir, permission requested to use: 101,102,103, 568-598.

On condition that you keep the size down to the minimum. We'll send your
license -- you have to post it on the wall, inspectors are entitled to see it
on demand.

> I've been using 568-598 for years, in my XyBasic compiler, to store
> constants... I use
> 101 to pass an error flag, and 102 and 103 pass data from child program to
> parent program.

> Is this a bad thing? It keeps the number of S/Gs down.

No, but it may be entirely unnecessary. Within a chain of programs, parents
and children, transient Save/Gets continue to live -- they even survive the
crash of a child (assuming the S/G in question wasn't a direct casualty of the
crash, i.e. was not part of the procedure that crashed). So as long as there
is no overall break in program execution (i.e. you don't restart sopme element
manually) , you could use a transient S/G as your flag.

One other, very important thing: use CLEARSGTS to wipe out the content of your
"compiler" S/Gs when you exit it -- and any other program utilizing permanent
Save/Gets that consume much memory. CLEARSGTS (much improved in the imminent
v115, BTW) does a remarkable thing, which native XyWrite cannot do (except for
"ordinary Save/Gets 0-9,A-Z): it not only zeroes out the length of specified
Save/Gets, it actually de-initializes them -- they are completely GONE! You
can re-initialize and re-use them at any time, of course, but for the nonce,
they vanish -- remember that even zero-length Save/Gets have memory overhead.

7+ Kbytes is too long for an XPL program! I'll bet its full of gratuitous
verbosity. Use HILITE to inspect the code; you'll probably find that
many S/Gs are used only once or twice, in a limited part of the program, and
can be re-used elsewhere. RENUMBER and RELABEL it so that it has a rational
structure. Then, at the end of the PM, say something like:

JM 2.clearsgtsQ2 ;*;

> BTW, since I make U2 calls, I "reserve" S/G 50--never use it.

Good boy.

-----------------------------
Robert Holmgren
holmgren@xxxxxxxx
-----------------------------