Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7435 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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?

Posted

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

Posted

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

Posted

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

Posted

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.

Posted

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.

Posted

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.

Posted

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.

This topic is 7435 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.