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

Re: Carl's notes



Damn! Wouldn't you know it: my most elegant use of VA@ comes when I run it
on a file that can have strings up to about 150 bytes. Now I'm going to
have to try Carl's parser on it.
** Reply to message from Carl Distefano  on Sat,
30 Aug 2008 14:41:34 -0400


> (If all you want to do is test whether a S/G
> is initialized, without querying its contents, use
> {less_than}0>...; S/G nn is unitialized if 
> equals -1.)

S/G nn is uninitialized if ==255.

A similar concept, with often-more-useful info, is
{less_than}1> or {greater_than}0>. That queries the
length of a S/G. In most cases, you don't care whether a
Save/Get is initialized -- you simply care whether it has
content. If the length is less than 1, the S/G is empty *or*
uninitialized. VA|nn is not only faster than using the
@SIZ(ISnn) operator, but it also pithily avoids an error if ISnn
doesn't exist (is uninitialized).

Carl is correct to underscore and warn that the VA@nn expression
only captures the first 77 chars, whereas ISnn gets everything.
That makes the use of VA@nn risky in many situations. In
practical, everyday coding, the risk-free procedure usually is:
{greater_than}0> then do something with ISnn, not
VA@nn 

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


Harry Binswanger
hb@xxxxxxxx