Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Good Place to Start writing Custom Functions?

Featured Replies

Thanks for checking this thread out -

I've lurked this forum a bit to get the feel of Custom Functions. Now I'm going to try my hand at a few, and wonder if anyone has seen a good tutorial on it that I can use for a little hand-holding.

I'm not new to FMP, having used it since the 2.1 days; but for some reason this is the first time I've thought about writing functions. Just jazzed about 7, I guess. anyway, any pointers to a guide would be much appreciated. Thanks for your time!

Tony

Hi Tony,

I'd recommend studying custom functions that others have created. In addition to learning how they work, you may find CFs that already do what you need.

There's two basic ways to use CFs:

First, for simplifiying a complex calc, hiding that complexity in the custom function. You send the CF a bunch of parameters, and the result pops out. It makes writing your calcs easier. A simple example might be a function to return the area of a circle from a radius. It could be done without the CF, but the CF simplifies things.

Second, to recursively scan through or loop through data to find or build a result. The ability to use recursion in custom functions is really what makes them powerful. If you're not used to programming, then recursion is a little abstract. Basically the function operates on a small piece of the data, then calls itself with the rest of data as the new parameter. The recursion continues until a stopping condition is met. Check out this simple recusive example of building a backwards string:

http://clevelandconsulting.com/support/viewtopic.php?t=50

Custom functions can be much more powerful than these simple examples, but that gives you the idea.

I use custom functions anytime I have a fiarly large calculation that I think I will use more than once. Just easier that way imo.

  • Author

Second, to recursively scan through or loop through data to find or build a result. The ability to use recursion in custom functions is really what makes them powerful. If you're not used to programming, then recursion is a little abstract. Basically the function operates on a small piece of the data, then calls itself with the rest of data as the new parameter. The recursion continues until a stopping condition is met.

Perfect. I use loops as a matter of course; this makes a lot of sense to me. Thanks Ender!

I also found the Brian Dunning CF Resource last night; studying those has been very helpful. Thanks again to all who responded.

Tony

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.