Jump to content

Good Place to Start writing Custom Functions?


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

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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