• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 351
  • Last Modified:

script not returning a find on partial field match

filemaker version 6.0v4Dev on windows xp

i am trying to write a script to search the database for a certain word or words in a certain field in each record and flag a field of the record when a match is made. it is my understanding that the = sign would do this in a search statment. however, if i put in a single word "DRAKE" as the search criteria,  i get no matches. If i put in 'DRAKE FABRICS, INC." which is the complete text in the field being searched, i get a match and the flag field is set.  the following is the script:

Show All Records
Got to Record/Request/Page[First]
Loop
    If ["Title of File = "DRAKE""]
        Set Field ["Marked Selection", "1"]
    End If
    Go to Record/Request/Page[Exit after last, Next]
End Loop

no match found on above search

putting:
 If ["Title of File = "DRAKE FABRICS, INC.""]

gets me a match and the flag field is set
0
kauakea
Asked:
kauakea
  • 2
  • 2
1 Solution
 
michael_georgeCommented:
Replace

If ["Title of File = "DRAKE""]

with

If ["PatternCount(Title of File = "DRAKE")"]

Any pattern matching "Drake" will result a non zero value (TRUE) and will set "Marked Selection" to "1"

The "Marked Selection" flag will be set for "DRAKE" as well as "DRAKE FABRICS, INC."
0
 
kauakeaAuthor Commented:
I get an error message:

"There are too few separators in this function"

when i try to change the if statement within the specify box to read

PatternCount(Title of File = "DRAKE")

0
 
michael_georgeCommented:
Sorry, instead of -

PatternCount(Title of File = "DRAKE")

I meant to type -

PatternCount(Title of File, "DRAKE")
0
 
kauakeaAuthor Commented:
thanks, that worked great for me. but i am confused. isn't the = operator supposed to do the same thing???
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now