December 27, 201015 yr I'm just curious as to the difference between the two scripted find methods that I have found while browsing example files and demos in Filemaker Pro. The first method I was exposed is: Enter Find Mode [] Set Field "Fieldx" (Find Criteria) Perform Find [] vs. Perform Find [RESTORE] Taking in to account a fresh found set, is there any difference between the two? The second method seems cleaner to me but it seems less used than the first method.
December 27, 201015 yr The main difference is that Set Field[] can set the field to the result of a calculation. An added bonus is that the criteria are visible when inspecting the script.
December 27, 201015 yr Author Are there any inherent disadvantages of using the first method over the second? Speed, etc...
December 27, 201015 yr Not that I am aware of. Well, three lines of code instead of one. But that's just cosmetics.
December 28, 201015 yr Not that advice from comment ever needs a second opinion, but I always use method 1, because the criteria is visible in the script. There are often "elegant" methods to accomplish something in FM, that bury your logic. Great when built, but often impossible to troubleshoot six months later. I try to avoid them.
December 28, 201015 yr Until FM11, you couldn't use Perform Find with a $variable, you needed to use Set Field[]. So out of habit I've always done the former. But I have started using the latter recently. For clarity, I comment what the Find criteria are, just like I do for Sorts.
Create an account or sign in to comment