KLA Posted April 11, 2002 Posted April 11, 2002 My quotes are correct i was just trying to distinguish the field names. As for exiting the script, i don't want it to exit even if the circumstance is true, i want it to keep looping through the rest of my found records.
Fitch Posted April 11, 2002 Posted April 11, 2002 OK, let's try it with some sample data: Let's say that: Record 1: Months Due = 1 Record 2: Months Due = 2 In both records, Months = 3 Due = "" The first record should return {result}: Loop . Set Field(Months Due, Months Due + 1) ... {1 + 1 = 2} . If(Months Due = Months) ... {2 3} .. Set Field(Due, "Due") ... {""} . End If . Go to Next Record, Exit after last End Loop The next record should return: Loop . Set Field(Months Due, Months Due + 1) ... {2 + 1 = 3} . If(Months Due = Months) ... {3 = 3} .. Set Field(Due, "Due") ... {Due} . End If . Go to Next Record, Exit after last End Loop Everything looks right to me! All I can say is insert a bunch of Pauses in your script and see what's going on after each step. Another option would be to use a couple of Replace commands instead of a loop. You'd have to test to see if it was any faster.
KLA Posted April 12, 2002 Author Posted April 12, 2002 I have this step in script: Loop Set Field("Months Due" , "Months Due" + 1) Go to Next Record, Exit after last End Loop This works to increment my months by one, however when it reaches a certain referenced number (my field "Months"), i need a "Due" field box checked. So, i added this step in the loop before the Go to Next Record: If("Months Due" = "Months") Set Field("Due", "Due") End If (the second Due is my value field for "Due") When i did this it made each record = it's "Months" (instead of +1) and checked the "Due" box. What am i doing wrong??
andygaunt Posted April 12, 2002 Posted April 12, 2002 Hi, try an Exit Loop If step in there. Loop Set Field("Months Due" , "Months Due" + 1) Exit Loop If [Months Due = Months] Go to Next Record End Loop
Fitch Posted April 12, 2002 Posted April 12, 2002 Looks right to me. Are you typing in the script steps or constructing them by selecting fields and calcs? Because this: Set Field("Months Due" , "Months Due" + 1) ... should look like this: Set Field("Months Due" , "Months Due + 1") ... and this: If("Months Due" = "Months") ... should be: If("Months Due = Months") Only difference is placement of quote marks.
KLA Posted April 19, 2002 Author Posted April 19, 2002 Oh, i see what you are saying... i read it wrong at first. I have what you said , and it does look right, however, for some reason, it make all my records = the months and checks them as due. (instead of just one upping the number) It doens't look like it should do that but, it does. any body else have a suggestion or see the prob? Thanks!
Fitch Posted April 20, 2002 Posted April 20, 2002 Again, I suggest: insert Pauses in your script and see what's happening after each step as you go through the loop.
KLA Posted April 20, 2002 Author Posted April 20, 2002 Sorry... i've been out of town... But i don't want the records to add to each other. They are independent of each other.
Gogargirl Posted April 20, 2002 Posted April 20, 2002 Let me hazard a guess: when you added in the If steps, did you create them by duplicating and dragging? If so, have you mistakenly left some of the steps unadjusted? For all the records to change, you must have an If test that is always true - something like If (Due = Due) SetField (Months Due, Months) SetField(Due,"Due") Instead of If(Months Due = Months) SetField(Due,"Due") This is so easy to do when scripting quickly and dragging a step you already used. I've done it many a time...
Recommended Posts
This topic is 8243 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