Warning: count(): Parameter must be an array or an object that implements Countable in /homepages/2/d244679652/htdocs/Blog/wp-includes/post-template.php on line 284

Blog By Night

The official blog of Fly By Night Graphics, Ltd.          Serving the Twin Cities since Tuesday!

FileMaker’s Let function

If you hang out on the the FileMaker forums (like TechNet), and pay attention to the advice given by those developers in the know, you will no doubt see heavy use of the Let function. I have to admit that at one point, I just didn’t get it. As a novice developer, it seemed like using Let was redundant and unnecessary in many of the example calculations. The official help documentation on Let can be found here.
However, it’s usually not until you see a great example, that it really “clicks” in your head. I don’t remember when that particular example was for me, but I recently came across another one that you may find helpful. Stuart Gripman of FullCity Consulting, Inc. had this informative and concise blog post as part of their “Function of the Week” series. You can read it here.
Another thing to keep in mind with the Let function is that it gets even more useful as your calculations grow in complexity. I cringe when I go back into some of my early FileMaker solutions and try to decipher some of the massively complex calculations I created, often with little to no white space formatting to improve readability or commenting (bad developer!). I had some that I had broken out into multiple fields, just to keep them organized. So I would have fields called something like Xcalc1 and Xcalc2, that would then be used in XcalcFinal to reach the total. All of this would be done very differently, knowing what I know today… especially the use of Let. The Let function will let you reduce the number of times a chunk of code needs to be calculated, and can reduce multi-field dependencies. These things may not matter much at first, but they can become major performance drains as your solution scales up, and as you expand to WAN clients and FileMaker Go clients.
Hopefully after reading Stuart’s post, you will “get it” much earlier than I did!

Published by Shawn A. Krueger, on September 4th, 2014 at 11:24 pm. Filled under: FileMaker,Geek. Tags: | No Comments |