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

Re: XPL pilgrim seeks audience



Reply to note from "Bruce Middleton"  Sun, 19 Dec
1999 03:34:31 -0800

-> XPL pilgrim seeks audience

Kick off your sandals. Your hajj is over.

-> *XPL's missing insert function*

The dilemmas you describe -- a constant source of irritation for XPLers
working in Xy3 -- were, happily, remedied in Signature and Xy4 with the
introduction of the operators VA!, VA|, VA and VA@. In Xy3, if you
wanted to find out whether a given Save/Get had content, you bumped into
a basic Catch-22: the test for content )>0 failed --
crashed the entire program! -- if Save/Get 01 was not initialized. The
workaround, which involved burying such tests in SUbroutines, was
exceedingly kludge-y.

Xy4 gives you several ways of testing whether a Save/Get is initialized
and has content. The most basic of these is VA!, which returns a
different numeric value depending on whether the Save/Get contains a
string (0), a SUbroutine (2), a numeric expression (4), an expression
evaluating to False (16), an expression evaluating to True (24), or is
not initialized (255). Thus  then Save/Get 01 contains a
SUbroutine, whereas <2> then S/G 01 contains a string -- and
the behavior of  varies accordingly. >254> then you
know that S/G 01 is uninitialized (so that, for example,  will
crash).

You obtain the length of Save/Get 01 with , which returns -1 if
the Save/Get is uninitialized. VA tells you whether the contents will
evaluate to an integer greater than or equal to 0 (returns 1 if yes,
else 0). VA@ returns the first 77 bytes of the string if the Save/Get
has content; otherwise, it returns the null string. This provides yet
another way of operating on a Save/Get without first testing whether
it's initialized. For example:
)=="YES">

Incidentally, your observation that a SUbroutine can be made into a
string by concatenating it with the null string, can be verified by
RUNCODEing the following examples (DECODE decodes, or open the
attached SUB01.TST).

XPLeNCODE v2.0
b-gin [UNTITLED]
{<}SU01,[NO_]{>}{<}SX02,{<}VA!01{>}{>}{<}PR@02{>}{<}EX{>} <==
 SUbroutine (S/G 02=2)[cr|lf]{<}SU01,[NO_]{>}{<}SX01,{<}IS01{
>}{>}{<}SX02,{<}VA!01{>}{>}{<}PR@02{>}{<}EX{>} <== SUbroutine
 (S/G 02=2)[cr|lf]{<}SU01,[NO_]{>}{<}SX01,{<}IS01{>}+""{>}{<}
SX02,{<}VA!01{>}{>}{<}PR@02{>}{<}EX{>} <== String! (S/G 02=0)
[cr|lf][cr|lf]
-nd
XPLeNCODE


-> *Instant Unrestricted XPL Access*

Synonym: RUNCODE. It's a XyWWWeb routine that runs DeFined XPL code,
even permits you to pass arguments to it, on the fly. A very handy way
to test, debug and use XPL.

Welcome to the list. Tell us more, please, about how you use XyWrite
and XPL.

--------------
Carl Distefano
CLDistefano@xxxxxxxx
http://users.datarealm.com/xywwweb/


--=_BASE64.PM_(XyWWWeb.U2)_v1.0
MIME-Version: 1.0
Content-Type: application/octet-stream; name="SUB01.TST"
Content-Transfer-Encoding: base64
Content-Disposition: inline; filename="SUB01.TST"

rlNVMDEs/4Gjr65TWDAyLK5WQSEwMa+vrlBSQDAyr65FWK8gPD09IFNVYnJvdXRpbmUgKFMv
RyAwMj0yKQ0KrlNVMDEs/4Gjr65TWDAxLK5JUzAxr6+uU1gwMiyuVkEhMDGvr65QUkAwMq+u
RVivIDw9PSBTVWJyb3V0aW5lIChTL0cgMDI9MikNCq5TVTAxLP+Bo6+uU1gwMSyuSVMwMa8r
IiKvrlNYMDIsrlZBITAxr6+uUFJAMDKvrkVYryA8PT0gU3RyaW5nISAoUy9HIDAyPTApDQoN
Cg==

--=_BASE64.PM_(XyWWWeb.U2)_v1.0