3 Replies Latest reply on Jun 25, 2012 7:58 AM by MichaelO'Halloran

    Help Trying to Create an Effective Find Feature



      Help Trying to Create an Effective Find Feature



      I am very new to Filemaker. I am trying to create a simple but effective database for my local sports club, who run a small lottery as their only source of funding the club.

      For past number of years the lottery is managed by physically examining tickets to see if any person matched 4 numbers and the bonus number.

      I have managed to create a database that enables a persons name and numbers to be inputed. Each number is assigned its own field, 5 fields in total. I need to be able to create a find script that will search the five fields to see it any person won the jackpot or matched 3 numbers and the bonus or justed matched 3 numbers.

      The script whould first have to ask what the winning numbers are before the find can be preformed.

      I dont know if this can be done in filemaker. It is certainly beyound my capability, but I hope somebody may have come accross this situation before or have a better idea in dealing with the issue.

      Kind Regards






        • 1. Re: Help Trying to Create an Effective Find Feature

          The numbers will be inputted in an order of some sort? Lowest to highest? Random?

          The numbers range from 00 to 10? 00 to 99?  001 to 999?

          Number fields are formatted as number fields?

          Sample numbers would be...

          01  11  23  34  B47

          B03  22  27  32  43

          • 2. Re: Help Trying to Create an Effective Find Feature

            Consider entering the winning numbers in a text field (global) and delimit the entries with a space:

            05 09 23 35 46 52

            and the customer's numbers in a text field but with a carriage return instead of a space between them:








            So now you have to global text fields with a list of numbers (as text) in each, the difference being that one is delimited with a space, the other with carriage returns.  We will process the winning numbers with a calculation: PatternCount ( <winning number field> ; <customer number value> ).

            The customer number field is processed with GetValue ( <customer number field> ; <index> ) with <index> being a counter variable as you will see.

            For matches we will also create a "results field" global field to hold the matches.


            Set Variable ( $loopCount ; 1 )


            If PatternCount ( <winning number field> ; GetField ( <customer number field> ; $loopCount ) )

            SetField ( <results field> ; <results field> & GetField ( <customer number field> ; $loopCount ) & " " )


            Set Variable ( $loopCount ; $loopCount + 1 )

            Exit Loop If ( $loopCount > <number of numbers used in the lottery> )

            End Loop

            Set Variable ( $numberOfMatches ; WordCount ( <results field> ) )


            That's the skeleton.  There are a lot of improvements you can do to this for your own needs and embellishments.  And there are others ways to solve this problem too, this is just one example but perhaps enough to get you thinking.


            William O'Keefe

            Frenel Solutions

            • 3. Re: Help Trying to Create an Effective Find Feature


              Thank You very much for the replies. I think its going to take a while to get my head around this.

              The help is very much appreciated.