Developer’s Guide

Table Of Contents
10-4 Developer’s Guide
Using the example plug-in
To access the external functions, do the following:
1. Install the FMExample.fmx file (Windows) or FMExample file
(Mac OS). See “Installing, enabling, and configuring the
example plug-in” on page 10-3.
2. In the Application Preferences dialog box, select FMExample to
enable the plug-in. Because the example plug-in includes a function
that requires configuration, the Configure button is enabled.
3. Click Configure.
The configuration dialog box that appears depends on how the plug-
in source code was written. The XPL-Format function in the example
plug-in displays the following configuration dialog box.
4. Click OK to use the default format, or type a new format. The “#”
symbols are replaced by numbers. All other text in the format string
is retained as is.
5. Click Done to close the Application Preferences dialog box.
6. In FileMaker Pro, choose File menu > Define Fields.
Xpl-Format,
<a string of numbers>
This function returns the parameter as a text string
formatted as specified in the configuration dialog
box. Use this function to format numbers such as
telephone numbers, postal codes, and so on.
Formatting proceeds from right to left. Each #
symbol in the format string is replaced by the next
number in the parameter string. All remaining #
symbols are replaced with zeros. The Xpl-Format
function is not designed to handle strings containing
alphabetical characters. For example, if the
parameter is a phone number like 1-800-ABC-DEFG,
the function ignores the alpha characters and returns
something like (000) 000-1800.
If the parameter contains more than 249 characters or
if there are more characters than there are # symbols
in the format string, then the function returns a -01.
Xpl-NumWords,
<numbers in a floating
format, like “44.345”
up to 9,999,999,999.99>
This function returns a number in bank check format.
For example 44.345 returns Forty-Four Dollars and
34 Cents.
All digits beyond the third decimal place and any
alphabetical characters are ignored. If there is more
than one decimal point, the function returns a -1.
Note The source code for the Xpl-NumWords function
is based on the calculation formula described in the
TechInfo article “Converting Numbers to Words or
Numbers to Text.” By writing the formula into the
code, this FMExample plug-in demonstrates how an
external function can save users hours of database
development time.
For a description of the formula, go to
www.filemaker.com/support. Click on the TechInfo
database link. In the search dialog box on the Web
site, choose Product: FileMaker. In the Article
Number box, type 104580.
Function’s name
and parameter Description of external function
Dialog box that appears when you
configure the example plug-in