John Chamberlain Posted December 5, 2003 Posted December 5, 2003 I have a script that finds a set of records. I want to go through that set and increment a series of counters, based on ZIP Code. I wrote a script (simplified to one ZIP only) as follows: If ["ZIP Code = 90266"] Set Field ["Undup Count 90266", "Undup Count 90266+1"] Set Field ["Undup Count Non~BCHD", "Undup Count Not 90266+1"] Go to Record/Request/Page [Exit after last, Next] End If The script runs, but the fields I want to increment do not return a value. The selected set of records totals 39, of which I know 2 are ZIP 90266. I have tried putting the fields in the Body, Footer, and a Summary field, but none of that helps. Could someone tell me what I'm doing wrong, and perhaps where to find a comprhensive article on setting up incremental counters in a script. Thanks,
Vaughan Posted December 5, 2003 Posted December 5, 2003 Is the Zip code field text or number? If it's text, the expression you have above in the IF won't work, because 90266 is a number.
Girwin Posted December 5, 2003 Posted December 5, 2003 It looks to me that your Go to Record/Request/Page step is in the wrong place. Because it's inside the If statement, it won't advance to the next record unless a match is found to that zip code. It should be after the End If step.
John Chamberlain Posted December 5, 2003 Author Posted December 5, 2003 Actually, ZIP Code is a calculation from a field called ZIP Code Extended. We did that because only a few persons give you the full 10 space ZIP. However the calculation returns a number result. So I tried creating a ZIP field that was a number, and hand entered the numbers for a test set of records. So the script reads: If ["ZIP = 90266"] Set Field ["Undup Count 90266", "Undup Count 90266+1"] Set Field ["Undup Count Non~BCHD", "Undup Count Not 90266+1"] Go to Record/Request/Page [Exit after last, Next] End If But that does not work either.
Oldfogey Posted December 10, 2003 Posted December 10, 2003 Sorry to aks what seem obvious questins. Have you defined the Undup Count... fields as Global Number? Do you initialise them to 0 before the If?
John Caballero Posted December 10, 2003 Posted December 10, 2003 Just for debugging purposes, put a Pause script step immediately after the IF step. If your script doesn't pause, then the IF condition isn't evaluating the way you think it should. And just for clarity's sake, this is part of a Loop script, right? I'm assuming it is, and you're just showing us a part of the script.
Recommended Posts
This topic is 7657 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