July 18, 200421 yr I have searched for help on this with no results. Using WINDOWS and FMP 6.0v4. Here is the situation: I have a data base with 419 records, and four fields: "Names", "Height", "Weight" and another named "Age". Can you help write a script that will go to a specific layout, find all the people named John and sort the found results descending by age, ascending by height and ascending by weight?
July 18, 200421 yr Hmm - I have never worked with FM6, and am just starting back in with FM7, but here are some loose suggestions. One way could be to write the script to pull the found set, then return a custom dialog. This dialg can be called something like 'Choose a sort method' and offer choices to sort by Age, Weight, etc. Or do you mean that you want 1 found set sorthed by ALL the criteria you mention, in that order and direction? Kurt
July 18, 200421 yr Author I forgot to say In a novice. I would like (at a touch of a button) get 1 found set sorted by ALL the criteria I mentioned, in that order.
July 18, 200421 yr Hi and welcome to the Forums, FM remembers your sort options, so 1. Create your script "SortwithMyCriteria" with dialog checked. 2. When the Sort dialog box opens, select your criterias, click Done 3. Perform your sort. 4. Reopen ScriptMaker, uncheck "dialog" Your sort is saved for this script. Now, create your Find script Go To Layout "X" Search Mode [Pause] Perform Search Perform Script ["SortwithMyCriteria"] HTH
July 18, 200421 yr Author Thanks Ugo DI LUCA: I was able to 1. Create your script "SortwithMyCriteria" with dialog checked. 2. When the Sort dialog box opens, select your criterias, click Done 3. Perform your sort. 4. Reopen ScriptMaker, uncheck "dialog" I can not create your Find script 1.Go To Layout "X" 2.Search Mode [Pause] 3.Perform Search 4.Perform Script ["SortwithMyCriteria"] I can not locate where "Preform Search" is I would like to seach specificly "John" within the "Name" field. I will keep looking, but thought I would let you know were I am at. Thanks
July 18, 200421 yr Hi again, Sorry, not an English version I have here, but Perform Search should read "Perform Find" GoToLayout[Your Layout] Enter Find Mode Set Field [NameField, "John" ] Perform Search You need the field "Name" on the layout.
July 19, 200421 yr Author This is still alittle different than what you had suggested for me to get my find Script-- I can: GoToLayout[Layout#1] Enter Find Mode (Restore) Set Field ["Name"] Perform Find/Replace ["John","", Find Next"] However, this will NOT bring up the students named "John" that are in the "Name" field in the layout. I might be doing something wrong.
July 19, 200421 yr It's "Perform Find" under the "Found Sets" area. "Perform Find/Replace" is something else entirely.
July 19, 200421 yr That one tripped me up the first time I started playing with FM7. Took me a while to figure out that Perform Find moved, along with all the other Find/Sort/Print script steps.
July 19, 200421 yr Hi, Without bringing too much confusion, you could also create a relationship matching "John", involving a global field for the left side and the Name field at right side. Please update your profile as it shows 6 as the FM version you're using.
Create an account or sign in to comment