March 29, 200124 yr I need to write a script that loops through a string of words and creates a multiple OR find, but have stumbled on something irritating . The script (which is incomplete) goes something like this. The field G_PLZ is a string containing Postal Codes, sparated by spaces e.g.(1234 6675 7785 12989) Set Field [ G_Number1, 1 ] Set Field [ G_Number2, WordCount(G_PLZ) ] Enter Find Mode Loop Exit Loop If [ G_Number1>G_Number2 ] Duplicate Record/Request Set Field [ PLZ, MiddleWords(G_PLZ;G_Number1;1) ] Set Field [ G_Number1, G_Number1 + 1 ] End Loop My question: where can I insert the Perform Find? The problem is that the loop increment counter becomes part of the find. I'd thought of switching layouts, but I believe Set Field doesn't need the field on a layout. I know someone out there has a solution for me! Tim
March 30, 200124 yr Try adding these steps to the end of what you already have: Set Field (G_Number1, "") Perform Find (no restore) Also, did you intend to use "Duplicate record/request" or "New Record/Request" ? Either way it looks like you are getting a blank find request because when you enter find mode, there will be a blank request ready to be filled in. But, the first thing that happens in your loop is to make a duplicate. I think you need to move the "Exit loop if.." and "Duplicate record/request" steps to the end of the loop.
March 30, 200124 yr Author Bob Thanks. You know sometimes the answer is staring right out at you, but I couldn't see the wood from the trees. You are right, I wanted a NEW REQUEST, not duplicate). Tim
Create an account or sign in to comment