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

Re: EXISTS WITHIN (Decimal-238, string exists within string)



** Reply to message from "Pierre d'Or jcvanhaeften@xxxxxxxx"
 on Sun, 23 Apr 2006 07:22:07 +0200


> I tried serveral possebilleties but they didn't work (see below
> or see qq.txt with xy)

All of your possibilities are incorrectly formulated. The expression
 X contained in Y ( or "{238}" )
returns a *numeric value*, not TRUE/FALSE. The numeric value = the position of
X in Y. If you write
 ;*;
 {238}>;*;
then the value of Save/Get 01 would be zero, because "A" occurs within "ABC" in
the first position, *starting from zero*. If  then Save/Get 01 = 1.
If  then S/G 01 = 2. If  then S/G 01 = -1 because "D" does not
occur within "ABC".

You express this within a conditional statement thus:
 {238}{greater than}-1>then do something
or
 {238}{less than}0>then do nothing

Xy4 introduces a TRUE/FALSE conditional of the type that you were trying
(unsuccessfully in Xy3) to use. The operator is character 240 instead of 238.
The expression
 Y contains X ( or "{240}" )
returns TRUE or FALSE.

You express this within conditional statements *only*, thus:
 {240}>then do something
There is no direct test for a FALSE result, i.e. you cannot say
{240})>. Furthermore (and very different from the 238
operator), a statement like {240}> is not meaningful (or
legal); it does not evaluate to TRUE or FALSE. But the 240 operator is very
succinct and useful, as a quick and dirty test for inclusion of one string
within another string.

Note the syntactical difference:
238: X is contained within Y - {238}
240: Y contains X - {240}

There are many many examples of both these operators in U2 -- SEarch for them!

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