Help with simple conditional?

Richard Kreiss rkreiss at verizon.net
Wed Aug 15 22:55:49 PDT 2012



> -----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 Fairlight
> Sent: Wednesday, August 15, 2012 7:56 PM
> To: filePro Mailing List
> Subject: Help with simple conditional?
> 
> I cannot believe this is not working.  I have no idea why so far.  I
double-
> checked the manual to make sure I remembered it correctly.
> 
> I'm doing a key field lookup.  It succeeds.  If I take the conditional
out, it will list
> every record.  The line I have problems with is this:
> 
> If: sintest(1) co SearchTerm
> Then: goto skipit
> 
> I originally had:
> 
> If: not sintest(1) co SearchTerm
> Then: getnext sintest;goto loop
> 
> Either -should- work, as far as I remember.  SearchTerm is definitely
defined
> and populated, as I've written the value to a logfile.  I have tried
different
> values for SearchTerm that I know are substrings of field 1 in various
records
> in the file being looked at.
> 
> If I use either method, I get no records matched.  If I comment out the
> relevant tests/logic, I get all records, so I know the lookup is good.
> 
> Is there some trick to using the 'co' contains operator that I've
forgotten?  I
> haven't used it in years in processing.  I usually only use it in IUA
short
> selection.
> 
> fP 5.0.14, Windows Native.
> 
> Thanks in advance...
> 
> mark->

Mark,

Ran a simple test in input processing and had the same results.

You could use strtok() to find the first letter occurrence of the word you
are looking for and then repeat using that value as a starting point to find
the first blank space and test if the length is the same as the word you are
looking for. If it is, do a mid() to get the word and then test if it is eq
to the word you are trying to match.  It may take a number of passes if
there is more than one word that matches the first letter and length.

I realize this is not as convenient as being able to do a "contain" but it
might work.

I have not tested this suggestion.

Richard





More information about the Filepro-list mailing list