using pipe in conditions

Kenneth Brody kenbrody at bestweb.net
Wed Jan 31 06:21:00 PST 2007


Quoting Walter Vaughan (Tue, 30 Jan 2007 20:23:47 -0500):

> Scott Nelson wrote:
>
> > Just wondering......
> >
> > I have seen the pipe used in ' if: not aa co "a|b|c" '  -  to test if
> > aa does not contain a or b or c.
> >
> > Why not as ' if: aa eq "a|b|c" '  - to shorten the condition line,
> > instead of   ' if: aa eq "a" or aa eq "b" or aa eq "c"

Because if aa is "b", then aa eq "a|b|c" is false.

> I never remember how to do this, but can't you use "co" contains to what
> you want like...
>
> aa co "abc" or is it "abc" co aa ?

If aa is a single letter, that works fine.  But, what if you are looking
for "foo", "bar", or "snarf"?  You can't use:

    "foobarsnarf" co aa

as this will also match "obars", for example.

However, you also can't use:

    "foo|bar|snarf" co aa

as this will match "nar", for example.

For cases like this, you need something like:

    "|foo|bar|snarf|" co "|"{aa{"|"

to make sure you are matching the entire value.

--
KenBrody at BestWeb dot net        spamtrap: <g8ymh8uf001 at sneakemail.com>
http://www.hvcomputer.com
http://www.fileProPlus.com


More information about the Filepro-list mailing list