Developer’s Guide

Table Of Contents
12-4 Developer’s Guide
Description of the FMExample plug-in’s
external functions
The FMExample plug-in provided ins the Microsoft Visual C++ and
Code Warrior Pro example projects adds the following external
functions to FileMaker Pro.
Function’s name
and parameter Description of external function
Xpl-Version, “ ” This function returns the version of the plug-in. It has
no parameters.
Note A version function similar to the one provided
in the example plug-in is required for every
FileMaker Pro plug-in.
Xpl-NumToChar, integer This function returns the ASCII character that
corresponds to the integer (1-255) passed to it.
Xpl-CharToNum, This function returns the ASCII integer value of the
character
character passed to it.
Xpl-Format, This function returns the parameter as a text string
<a string of numbers>
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.
Function’s name
and parameter Description of external function
Xpl-NumWords, This function returns a number in bank check format. -
<numbers in a floating
For example 44.345 returns Forty-Four Dollars and -
format, like “44.345”
34 Cents. -
up to 9,999,999,999.99>
All digits beyond the third decimal place and any
alphabetical characters are ignored.
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.
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 12-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.