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

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

Recommended Posts

Posted

I have a script that runs thousands of loops, and for some reason gets slower and slower as the number of loops gets bigger. When the script starts out, it executes about 1 loop/sec, but as it continues it slows down to 5-10 secs/loop, which is painful.

One problem (perhaps not the only one) is when it gets to a "Go to Layout [original layout]" step. This step takes about 5 seconds to execute (in the script debugger). And, for some reason, a "sorting records" dialog flashes on the screen each time that step executes (I am single stepping using F5 button).

Now I can see the window when this script steps executes and it goes from one layout to another, and both are listed as Unsorted. But when I single-step the script, up comes the "sorting records" modal dialog.

I haven't tested this fully (it takes about 2 hours of script execution before this shows up), but I have a feeling that it does not occur in FM 8.5, but does in FM 10 and FM 11.

Has anyone else seen this strange behavior?

Posted

Has anyone else seen this strange behavior?

No.

If you want a more meaningful answer, you might want to give more meaningful details, such as the steps of the script that you're having problems with, and maybe even details about what the script does. :

I have a feeling that it does not occur in FM 8.5, but does in FM 10 and FM 11.

Think about what features are in FMP 10 and 11 that are not in FMP 8.5. (The sort dialog might be significant.)

Posted

The change Vaughan possibly hints to is dynamic reporting! I would see if a clone of the layout deprived from any other part but the body would cause a change in behaviour ... even a blank layout attached to the particular TO does from time to time make sense even though a sprinkling of the scripting with the:

http://fmhelp.filemaker.com/fmphelp_10/en/html/scripts_ref2.37.8.html

...often makes wonders! But by and large should layouts for scripting not include any summary fields, if need be, use:

http://fmhelp.filemaker.com/fmphelp_10/en/html/func_ref3.33.43.html

--sd

Posted (edited)

Thank you both. You caused me to look at this more fully, and I solved it. The problem was in the layout, not in the script.

I was looping through thousands of records from layout A. Each loop would change to another layout, do some work, and then return to layout A and go to the next record.

The problem was that (a) Layout A displayed--purely for debugging purposes--some fields from related tables and (: the field for the relationship was not indexed in those other tables.

I don't know why this was the case--the relationship was through calculated text fields, with indexing set to "None. Automatically create indexes as necessary" on both sides of the relationship. For some reason the indexes were not being created in one table. Changing Indexing to "All" fixed the problem.

The database was created in FM 8.5 and I am now running 11. I have no idea why automatic indexing failed to apply.

Thanks again

A

Edited by Guest

This topic is 5299 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.