Jump to content

Will this script work?


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

Recommended Posts

Brad, i would use the Replace Contents script step instead of looping. Show All Records, make sure you're focused on a layout where b, c, and d are all visible, then Replace Contents ( b , Case ( a = b , "" , b ) )

This should go more quickly than looping.

Jerry

Link to comment
Share on other sites

There is some controversy about which is better or faster. Many developers whose files are used in a networked environment use Loop instead of Replace. With a Loop you can get an error and trap records which may be locked by other users. In the case above it doesn't sound that critical. Even less of a problem with version 7, but still possible for a user to lock a record while editing.

The main reason Loops are slow is because they don't have these 2 steps first:

Freeze Window

View as Form

They are many times faster with those steps, about the same speed as Replace on networked files. Replace has a "gotcha" in that the field must be on the current layout, whereas Set Field doesn't care.

Link to comment
Share on other sites

Fenton said:

Replace has a "gotcha" in that the field must be on the current layout, whereas Set Field doesn't care.

Just wanted to point out this also no longer applies to FM7, you can perform a Replace now on fields that are not on the layout.

Link to comment
Share on other sites

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