Diana, Cda Posted October 24, 2002 Posted October 24, 2002 What does it signal to you all when a sort doesn't alphabetize properly? Before and after a manual sort, the sort box shows the right sort commands are present. The "perform find" button doesn't change these, they remain the same after the find is done, which signals that the correct set of sort commands are being carried out (versus a change meaning the sort is not the one you want). Only, the results don't come up alphabetically, ascending. I click, to be on safe side, the "replace" radio button instead of "keep" when re-closing the script. Nothing. After performing the find, I can press the manual "sort found records" and everything snaps into proper order but even if I call this very same script from the "perform find" button after the actual "perform find" command (and even before that command, no matter) the results, again, are not correct. Sorting will work manually, but not called in any way, shape or from within script. Bottom line is that I can't get the found results sorted unless I actually click on the sort button myself. What the hell is going on with all of this? Anyone have an inkling? (for first time am enclosing a copy of my original file which has records in it so that it can properly be tested. I am close, folks. So close to completing phase I. Thanks!) Recipe Cataloguer.zip
Vaughan Posted October 24, 2002 Posted October 24, 2002 The "Find All (M)" script is thus: Enter Find Mode [Restore] Set Field [source, "M"] Perform Find [restore, replace found set] Sort [restore, no dialog] The problem here is that the "Perform Find [restore]" step kills the find request that you just entered with the "Set Field" step. The solution is to de-select the restore option for boith the Enter Find Mode and Perform Find script steps. Even simpler, perform the find manually, then do the sort you want. Then open the script and change it to just these two lines: Perform Find [restore, replace found set] Sort [restore, no dialog] When you close the script, be sure to update both the find request and the sort order.
BobWeaver Posted October 24, 2002 Posted October 24, 2002 Sorts must be done after you have finished performing a find. You have put a Sort command after the enter find mode step. At that point you are still in find mode with no records to sort yet. Remove it from that script, and create another script called from the "perform find" button with these steps: Perform Find Sort [ Sort Order: Recipe title (Ascending)Page # (Ascending)# on page (Ascending) ] [ Restore sort order, No dialog ]
Diana, Cda Posted October 24, 2002 Author Posted October 24, 2002 Vaughan, aha, proof-positive that there must be a glitch somewhere. I am a newbie to advanced FMP, but in all the years I've played around with this app in various incarnations (Mac, Win3x and Win9x, two languages), I don't recall ever making all the combination changes I did and _not_ having something show up somewhere. Even following your instructions to the letter, it didn't work. btw, all those extra restores and all of that, I selected, de-selected in every combination possible WITH NO effect whatsoever. Yet the basic steps are the only ones you see there in the ENTER FIND and PERFORM FIND scripts. Why all this is so, I don't know. Anyhoo, will address the next message below since obviously, need to figure out a way around this glitch. Thanks! Good to have confirmed that I'm not, after all, going crazy!
Diana, Cda Posted October 24, 2002 Author Posted October 24, 2002 Hallelujah, BobWeaver, this is probably going to be the only way that this problem can be fixed, actually hardcoding the sort within the script. I followed Vaughan's instructions above to the letter and the results did not work. Vaughan assures me they will so I've concluded that my concerns that there might be something wrong in this installation of Windows/FMP is true [hey, I've got other things happening that shouldn't in Windows and all, why not FMP, too! ]. Re all the restores and sorts I'd put in all over the place, that was in an attempt to see change, any change within the results. Nothing I did worked even the things that I felt might not do the trick. You caught the two scripts in the messy after-effect of all those changes since I started out with clean ones and I should have removed them since they weren't doing any good anyway. Sorry about that. Your coding mentions putting the sort criteria right into the script and not falling back on FMP's usually foolproof "remember last sort and use that" type of routine. > Sort [ Sort Order: Recipe title (Ascending)Page # (Ascending)# on > page (Ascending) ] > [ Restore sort order, No dialog ] How did you code in the "Sort Order:" line? When I "move" the "Sort" command (found under SORT/FIND/PRINT) into the script, I don't see any options to change the sort criteria only the two checkboxes, "Restore sort order" and "Perform without dialog". Where were you able to input this string? Cool, and learning that will save me all sorts of difficulties in future. What a great forum this is!
LaRetta Posted October 24, 2002 Posted October 24, 2002 Diana, One thing you might look at. I noticed that your find buttons appear to have more than one script attached to them. Are they the buttons you cut and pasted? If so, you might select the buttons, ungroup them and reattach your scripts. I've done that copy/paste of buttons and inadvertendly got problems because of other scripts attached to them. I'm probably wrong ... I frequently am, but it might be worth a looksie! Have a great day!
Diana, Cda Posted October 25, 2002 Author Posted October 25, 2002 Hey, no I didn't see that at all!! Thanks for pointing this out. Wow! That would definitely put a monkey wrench in the works ... Off to check this out now.
BobWeaver Posted October 25, 2002 Posted October 25, 2002 Hold on. You misunderstood. I didn't hardcode the sort order into the script. That is simply how the script appears when printed. That was the original sort order you get when you use the restore option. The point I was making was that you had put the sort step right after you entered find mode. You can't do that because in find mode there are no records found yet, and hence nothing to sort. BTW, I was referring to the Find(M) script that you had attached to the find button. You need to do the sort after you have finished performing the find. You had the perform find done directly by the "perform find" button. That won't work. You need to have the "perform find" button execute a script that does a perform find and then a sort. Here is your sequence of events. 1. User clicks "Find" button which executes the Find(M) script: -Enter Find Mode -Set [source, "M"] 2. User enters any other search criteria 3. User clicks "perform find" button which should execute this script: -Perform Find -Sort[restore]
Diana, Cda Posted October 25, 2002 Author Posted October 25, 2002 Gotcha BobWeaver. I believe I explained all those extra steps. Yes, logically, one would assume you'd do the sort _after_ a find. My mistake was in leaving all those other codes in that I added when desperately and randomly trying to see if something/anything would show up when this function didn't work. LaRetta was the one who pointed out the potential problem. I looked at the perform find and didn't see that but I did find that I had two mask buttons present, one hidden beneath the perform find in addition to the one on top. I don't know if two mask buttons would do anything but I removed the unnecessary second one. I also unchecked the script to the perform find and re-assigned it. Without changing anything else, these two things seemed to have done the trick (so far, at least). So, I now seem to have a working find process (hallelujah!!! ). ************************* I did have one problem, though ... as per "close two doors but a third one then opens <g>" ... The perform find seems to work great except when one tries to find something that is not there and one hits the "cancel" button in the error box. Cancel gets us back to the layout but returns ALL records. How do I code for this cancel possibility so that I get returned back to the layout showing only those records pertinent to it and in alphanumeric order? I'm attaching my db in case I didn't explain well enough. To see what I mean, search for "cake" in the Category field in the BOOK layout and then press "cancel". Thanks all! 2002.10.25#1 - Diana.zip
Diana, Cda Posted October 25, 2002 Author Posted October 25, 2002 Thanks LaRetta! You signalled me to look in the right area. I didn't actually find the potential problem you stated re more than one script assigned because of a cut-and-paste but I did find problems which I outlined in my response to BobWeaver, second paragraph. Thanks muchly! You taught me an additional step to use when troubleshooting, what I call "conflicting codes"-type of situation in an app like WordPerfect.
CobaltSky Posted October 25, 2002 Posted October 25, 2002 To return the database to its former state if no records are found, you need to start the script out with the command Set Error Capture [On] and then, immediately after your Perform Find [ ] step, you need to test for a 'no records found' error (which is error code 401 in FMP. So you need a few extra steps after your Perform Find [ ] step, along the lines of: If ["Status(CurrentError) = 401"] Perform Script [sub-scripts, "Set-up Database"] EndIf Where the Set-up Database script is one which locates the records for whichever layout you want to go to and takes you there.
Recommended Posts
This topic is 8069 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