User manual

Table Of Contents
Using formulas and functions
11-5
About functions
A function is a predefined, named formula that performs a specific
calculation and returns a single, specific value. You type the
function, and FileMaker Pro performs the calculation it represents.
Here are some examples of functions:
Most FileMaker Pro functions use the following syntax:
Function name (parameter)
Some functions require two or more parameters, as in this example:
Position(LastName,"Mc",1, 1)
You can use functions by themselves or combine them with other
functions or expressions. For example, you can nest one function
within another:
If(IsEmpty(LastName), “Warning!”, “OK”)
For more examples showing how to use calculation formulas and
functions, see the Calculations and Scripts file in the Tips from Tech
Support folder in the Templates folder in the FileMaker Pro 5 folder.
Note In the United States, commas act as list separators in functions,
formulas, and calculations. In other countries, semicolons might be
used as list separators. The separator depends on the operating
system your computer uses, as well as the one used when the file was
created.
The following sections summarize the FileMaker Pro functions by
category. For detailed information about each function, and
examples, choose Help menu > Contents and Index, click the Index tab,
and type the name of the function.
Text functions
Text functions manipulate text. Use text functions to combine,
isolate, compare, quantify, change, or convert data of type text.
The parameter text can be a text expression (in quotes if it is a
constant) or the name of a Text field. To use a space as a text
expression, type a quote, then a space, then a quote (" ").
Example: RightWords(Name, 1) returns Jones when the Name
field holds William R. Jones.
This function Returns
Average (Score1, Score2,
Score3)
The average of the three scores
Round(SalesTax,2) The amount of sales tax rounded to two
decimal places
Length("John") 4 (the number of characters in the text
"John")
Position(Name,"Mc",1,1) The position of the first occurrence of
"Mc" in the Name field
This part Represents
Function name The calculation to perform.
parameter The value or expression on which the calculation is
performed. Most functions require one or more parameters. A
parameter can be a constant, a field name, another function,
an expression, or a database structure or situation.
( ) The beginning and end of the parameter.
Syntax Definition
Exact (original text, comparison
text)
Exact (original container,
comparison container)
Compares original text and comparison text.
Returns "1" if they match exactly, "0"
otherwise. Exact is case-sensitive.
Compares original container and
comparison container for exact match.
Returns "1" for a match, "0" for no match.
Left (text, number) Returns the character(s) in text specified by
number, counting from the left.
LeftWords (text, number of
words)
Returns the word(s) in text specified by
number of words, counting from the left.