Why do you have the boxed label “Exit after last” checked when you are not in a loop?
Peace, love & brown rice,
FileMaker + Web: Design, Develop & Deploy
Certifications: FileMaker 9, 10 & 11
<http://www.onepartharmony.com/> One Part Harmony
Austin, Texas • USA
So you can confirm you're seeing the same behavior?
According to the help file it shouldn't make a difference, so I never ensured it was checked or not.
http://www.filemaker.com/11help/html/scripts_ref1.36.19.html "Note Exit after last will exit a loop but does not stop or exit a script."
Now I've got to double check any script that uses the script step and make sure that box isn't checked.
I have to second Morgan's query.
I can also make scripts misperform by using an inappropriate step at the wrong place, but the whole point of good scripting is to not to do that.
I can't recall every choosing Exit After Last outside of a loop because that's what its for, exiting loops. That it has undocumented consequences if invoked elsewhere is not really unexpected behavior, though worth knowing.
When I look at that link, it reads "Exit after last tells FileMaker Pro to exit the script or control structure (like a loop) when it reaches the last record in the found set."
Huh, the help file contradicts itself. I had skipped ahead to the Note, that explicitly says something different...Certainly something worth keeping an eye on.
Previous moves to the previous record in the file or found set, displays the previous find request, or moves to the previous page in a report. Exit after last tells FileMaker Pro to stop the script when it reaches the last record in the found set. You can use Exit after last with the Loop script step to exit out of a loop after the last record.•
Next moves to the next record in the file or found set, displays the next find request, or moves to the next page in a report. Exit after last tells FileMaker Pro to exit the script or control structure (like a loop) when it reaches the last record in the found set.•
By Calculation lets you create a calculation to determine the index number for the desired record, find request, or page in Preview mode.
Note Exit after last will exit a loop but does not stop or exit a script."
Yeah...I've been caught by stuff like that before. I'm just glad I don't have to maintain their documentation.
Others that I've caught I sent in as a bug...for the documentation. lol
And get(lastError) in the calling script returns the usual error for going to last record (101).
We need to be able to trust the documentation literally and the portions you quoted clearly contradict, clearly ...
"Note Exit after last will exit a loop but does not stop or exit a script."
I would send it in as a documentation error as well. Thank you very much for being willing to bring it to light.
If your file you have 2 scripts.
The first one takes you to the first record and then you try to go back one more by saying go to previous. So it exits because the 1st record is in a sense the last record before you try to go to the one before it.
The second script is more typical... it goes to the last record and seeing as you ARE on the last record then trying to go to the next record will also exit right there on the spot and throw that lovely error.
One thing we like doing is turning on Pause on error and be notified with the debugger when we actually hit a real error.