Custom Functions
Often, you need to use a particular calculation more than once. Perhaps you have several tables that hold information about people and you want to write that “Full Address” calculation only once, and then use it in each table. Or you might find yourself wondering why FileMaker doesn’t have a function to do some incredibly useful thing. Maybe you frequently need to calculate your custom sprockets’ weight, and FileMaker (for some odd reason) doesn’t have a MySprocketWeight function. In all these cases, you can define your own functions to get the job done.
Defining a Custom Function
To get started, you’ll add a new function that can calculate the circumference of a circle. You may not actually need to calculate circumferences in your own data-bases much, but this example illustrates important concepts common to creating any custom function.
Note
If you don’t have the FileMaker Advanced edition, you’ll have to sit these next few exercises out, as explained in the previous Note.
In FileMaker Pro Advanced, choose File → Manage → Custom Functions.
You see the window shown in Figure 12-1. If you’ve never created your own function before, the list is blank—but not for long.
Figure 12-1. The Manage Custom Functions window (File → Manage → Custom Functions) is where you go to create your own functions. It shows a list of custom functions that are already defined. You also get buttons ...
Get FileMaker Pro 9: The Missing Manual now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.