taigo Posted November 19, 2009 Posted November 19, 2009 in a found set i want to replace the value of serveral fields with a value tha in in the paramaters ($para1; $para2,$para3,....) what is considered as best practise (works faster) working with a loop function: loping trough every record in the foundset and replace the value with the "set field" scriptset example: Go to Record/Request/Page [First] Loop Set Field [Table1::field1; $para1] Set Field [Table1::field2; $para2] .... Go to Record/Request/Page [Next] Exit Loop if [Get (RecordNumber) = value] End Loop or with the "replace field script set? after i have sorted the found record set example: Replace Field Contents [No dialog; table1::field1; $para1] Replace Field Contents [No dialog; table1::field2; $para2] ..... according my experience the replace field scriptstep takes also a amount of time to be executed thanks Freddy
Ocean West Posted November 19, 2009 Posted November 19, 2009 It depends are you in a multi user environment?
Fenton Posted November 19, 2009 Posted November 19, 2009 I haven't done much comparisons since FileMaker 5 days, but if you have to do more than 2 fields, the Loop is going to be faster, especially on hosted files. As Stephen was alluding to, they are also safer, because you can optionally trap for errors and capture the IDs of records which were locked by other users editing the fields (though what to do about it is kind of a problem; good reason why mass changes of data on live multi-user files is something to be avoided if possible). One thing that used to make a big difference in the speed of Loops in List view layouts was to View as Form before the loop began, then return to List view afterwards. It has to do with keeping the scroll bar from having to update. Freeze Window (first) is also a good idea. But I only do the above View change if there are a lot of records. Otherwise the speed difference is negligible. It seems to me that later versions of FileMaker do Loops faster than they used to.
taigo Posted November 19, 2009 Author Posted November 19, 2009 thanks for the great explination, and yes i gonna to change the layouts in list view, hope it will speed up things i gonna change also the scripts in loops tommorrow thanks again freddy
Fenton Posted November 19, 2009 Posted November 19, 2009 You just use the View As [ Form/List/Table/Toggle ] script step to change the View temporarily to Form, then run the Loop/End Loop, then change it back to what it was. If you have Freeze Window then the user does not see the change; but apparently FileMaker does, and runs the Loop faster, because it doesn't have to keep updating the scroll bar (which normally moves down the list).
taigo Posted November 20, 2009 Author Posted November 20, 2009 so for the good undestanding: it is in FORM view that the results are better, not in ist view?
Fenton Posted November 20, 2009 Posted November 20, 2009 Yes, because in Form view, FileMaker does not have to update the scroll bar as you move between records, which apparently adds some overhead. You do this switch during the script, before the Loop starts, after a Freeze Window step. Then, after the Loop finishes, you switch back to List view. The actual script step used is: View As, down at the bottom of the Windows section of scripts.
Vaughan Posted November 20, 2009 Posted November 20, 2009 In list view, FMP has to load all of the data for the records that are visible on the screen. This involves working out which records are on screen as well as working out which data is cached and which is on the server... a lot to do, each time the record current record changes.
taigo Posted November 20, 2009 Author Posted November 20, 2009 is the number of fields visible on the formview of any importance or just limit the number to the minimum? is the same happening in case of a search? for example: what in case of searching a set of records to delete them afterwards pe best to do the search in form view also? thanks a again i like it when something is done for a reason, this info is hard to find in books!
Recommended Posts
This topic is 5482 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 accountSign in
Already have an account? Sign in here.
Sign In Now