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

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

Recommended Posts

Posted

Which, in your experience, is faster: Replace Contents or Loop? I've run some tests, and over a network they seem to be the same. Running on a local machine Replace seems to win the race.

The database I'm working on contains a hierarchical list of records, and functions similar to the Finder in Mac OS: click the triangle to toggle records open & closed with in the hierarchy. The problem comes when I run a script to show all, or hide all. The field which indicates how the triangle is to be displayed must be set to either 1 or 2 (depending on whether the records are being opened or closed) for every record displayed. This can be a quite lengthy process, when displaying thousands of records.

Does anyone have a better solution to this problem? Or should I give up on the changing status of the triangle graphic for better speed.

Posted

It depends. Replace is faster in some cases, but if you're replacing on more than one field, a loop may be faster because you can enter a field, then set your data in multiple fields, then exit the record. With Replace, you'd be multiple record locking/unlocking. Try Freeze Window before your loop, that can help a lot. Also keep in mind that Replace or Loop can both fail in a multi-user setting, because a record that is in use will be skipped.

Here's an idea: use an alternate layout for show/hide all. On this layout, use a global graphic container. Or use two layouts, and just put your graphic right on the layout. Either way, no loop/replace necessary.

Posted

If you display the records in a portal, you can control which records are displayed by setting a global field on the left side of the relationship. This method doesn't use replace or a loop and is extremely fast.

-bd

Posted

You don't, but I thought the desired end result here was to generate a hierarchical display in a list of records, something like:

A

B

C

When you click on A

A

1

2

3

B

C

I've typically generated this display with some combination of compound and multikeys.

Sorry if this isn't the ultimate goal, I might be misunderstanding the question. Also, Vaughan and Bob give me way too much credit to know tricks they don't! wink.gif.

-Brent

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