using contains for multiple numbers
Richard Kreiss
rkreiss at gccconsulting.net
Sun Jul 13 20:09:30 PDT 2014
> -----Original Message-----
> From: filepro-list-bounces+rkreiss=verizon.net at lists.celestial.com
> [mailto:filepro-list-bounces+rkreiss=verizon.net at lists.celestial.com] On
> Behalf Of Jay Ashworth
> Sent: Friday, July 11, 2014 12:45 PM
> To: FilePro Mailing List
> Subject: Re: using contains for multiple numbers
>
> ----- Original Message -----
> > From: "Richard D. Williams" <richard at appgrp.net>
>
> > I have not done this, for a long time and I know I have see it done.
> >
> > I have a field that may or may not contain a number (0-9).
> >
> > I want to write an IF statement testing this to be true or false.
> >
> > Is it,
> > if : 4 co "123467890"
> >
> > or
> >
> > if : "1234567890" co 4
> >
> > or
> > if : "0|1|2|3|4|5|6|7|8|9" co 4
>
> The second, unless you can't guarantee that 4 is a single character field, in
> which case the third is smarter. The third is always more rugged.
If the value being looked for is a constant one could use:
QQ;=strtok(4,"4")
If: qq ge "1"
Msgbox "the number 4 is present:END
If: qq = "0"
Then: msgbox "No Number 4";END
The value of qq will be the position of the number 4 is present, otherwise qq will be 0
This is a handy function when you want to search for a particular character or characters which are not an expression.
You may need to use the value of qq as the starting position for next strtok() if you are looking for more than one character value.
Richard Kreiss
GCC Consulting
Office: 410-653-2813
More information about the Filepro-list
mailing list