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
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> )
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.
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.