Functions Reference

Table Of Contents
Logical functions
F
ILEMAKER PRO FUNCTIONS REFERENCE 240
Let
Purpose
Sets a variable or variables to the result of the specified expression(s) for the duration of the
calculation, or until the script exits or the file is closed.
Format
Let({[}var1=expression1{;var2=expression2...]};calculation)
Parameters
var - any variable name, local variable name, or global variable name (see About naming fields for
guidelines on naming variables).
expression - any calculation expression, field, or constant.
calculation - any calculation expression, field, or constant.
Parameters in braces { } are optional.
Data type returned
text, number, date, time, timestamp, container
Originated in
FileMaker Pro 7.0
Description
The Let function allows you to assign the results of expressions to variables and return a result that
can use those variables. Use
Let to make complex formulas easier to read by reducing the need for
calling functions within functions.
Let can also make formulas more efficient by storing the result of
function calls in variables for re-use within the formula, reducing the number of redundant function
calls.
To assign multiple variables in one Let function, use a list syntax enclosed in brackets [ ] and
separated by semicolons. To make multiple variables easier to read, you can put each variable and
the returned calculation on separate lines, though this formatting is not required. For example:
Let ( [
variable = value;
variable2 = value2
];
calculation )
Three types of variables can be declared in a Let function:
variable a variable (with no prefix), which is available only within the function where it is
declared
$variablea local variable (prefixed with $), which is available only with the script where
it is declared
$$variable – a global variable (prefixed with $$), which is available anywhere within the
file where it is declared