September 19, 200223 yr I have a script that's scrolling through and running a test on 73 found records of a 78 records set. IT runs in a loop, and it has a step saying Go to Record (Next, Exit After Last), but it just runs, in an infiinite loop, on the last record. Ideas why?
September 19, 200223 yr Hello: Sounds like you need the End Loop step in there after Go to Next exit after last. Do you have this? Ken
September 19, 200223 yr Author Apparently there's something I don't udnerstand. The help files say that checking the exit after last makes the script, when it reaches the lst record, exit the innermost control structure, which would be, in this case, a loop. So... why isn't it exiting? And why do I need an Exit loop command?
September 20, 200223 yr Is there a "Go to Record/Request [first]" script step INSIDE the loop? This would keep the script from ever getting to the last record.
September 20, 200223 yr Ive had a lot of fun with loops. You might want to try: Set Error Capture [On] (Do this so you can get out of loop) Enter Find Mode [] (Whatever your finding) Perform Find Go to record/Request/Page [First] Loop (Your critera here) (This will perform on 1st record) Go to record/Request/Page [Exit after last, Next] End Loop I agree with Vaughn dont put Go to record/Request/Page [First] in the loop or as you have seen it will loop forever. Dean
September 25, 200223 yr Author Remarkably enough, the code you guys just sent is almost EXACTLY what I had in there, except for one important difference - I didn't have the go to record(first) in there at all! So I put it in outside the loop, and it worked. I'm not sure why it looped forever - after all, if it entered the loop, and it was alerady on the last record, wouldn't it just do one iteration of the loop - but that fixed it. It was a fault in logic anyway - I needed it to loop the whole found set every time, and just forgot to reset the pointer, as it were - but nonetheless, it doesn't seem like it should have solved this problem. But there you have it. THanks for your help!
September 26, 200223 yr "Go to record ... Next" has always been a bit... quirky. I don't know why, but if you don't have it set up just right (as was pointed out above), it just keeps going or doesn't get the right information at all.
September 26, 200223 yr If your database is already on the last record when you call the Go To Record [Exit after last, Next] command, then the command fails because there is no next record, and having failed its parameters cannot be applied, including the 'exit' request. I suspect that may be why you were having trouble...
Create an account or sign in to comment