whun450 Posted February 22, 2008 Posted February 22, 2008 Hello all, I wonder if someone can help me with this. I have field1 that has text like "The shiny red car went fast" I have three other fields that each have a word like: 'shiny' 'car' 'fast' Since those 3 fields match words in field1, I would like to do a calculation that assigns points based on the amount of keywords in field1. In this case each of the 3 words is worth 10 points so my calculation field would equal 30 points. What I'm not sure how to do is to match the keywords with the line of test. Hopefully I explained this right and thanks in advance for the help. William
mr_vodka Posted February 22, 2008 Posted February 22, 2008 Maybe something like... gKeyword1 = global field gKeyword2 = global field gKeyword3 = global field gPoints = global number field Let ( m = " " & gTextField & " "; gPoints * ( PatternCount ( m ; " " & gKeyword1 & " " ) + PatternCount ( m ; " " & gKeyword2 & " " ) + PatternCount ( m ; " " & gKeyword3 & " " ) ) )
whun450 Posted February 22, 2008 Author Posted February 22, 2008 That works great! Thank you so much for your help John!
Recommended Posts
This topic is 6179 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now