RichJr Posted April 20, 2001 Posted April 20, 2001 I am trying to write a script that changes one value to another, but only in a condition. here is the script: Go to Record/Request/Page [First] Loop If ["state="california" "] Set Field ["state" , "state="CA" "] Go to Record/Request/Page [Next] End If Exit Loop If ["Status(CurrentRecordNumber) = Status(CurrentFoundCount)"] End Loop This seems to go infinitely and when I cancel, all the values are zero. Also, How do I set a variable? As this script shows, I need to change the parameters each time I want it to find a state, or write a script for each state. I would ultimately want to write a script with each state set as a variable, and loop through the entire database. Is this the best way? Any help with this problem would fantastic. Rich
markpro Posted April 20, 2001 Posted April 20, 2001 If you want to use variables, why not try a slightly different approach. Create two global fields to act as set find variable fields. I'll call them gstatelongname and gstateabrev. Once you enter the state you are looking for in gstatelongname and enter the abreviation to be used in gstateabrev you could perform a script such as: Enter Find Mode set field State gstatelongname Perform Find Replace [state, Replace date:Calculation:, gstateabrev] no dialog
LiveOak Posted April 20, 2001 Posted April 20, 2001 The problem with your script is that the "Go to Record/Request/Page" step is inside your If..End If. As soon as you reach a record without state = california, you will be stuck on this record forever. Move this statement below the End If. -bd
Recommended Posts
This topic is 8622 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