Literals

There are five kinds of literals in ACF:

Literals with Special Meaning:

Some literals have special meanings and trigger the FileMaker evaluation engine to retrieve their content. These literals are in addition to the "eval" function, which takes a string expression as an argument. The literals with special meaning are:

Data Types

In ACF, various data types are used to represent different kinds of values. Here is a list of ACF data types along with their corresponding C++ types and descriptions:

Type Name C++ Type Description
int int Integers, hardware-dependent 32-bit or 64-bit integer values. The actual size can be obtained with the size(a int variable) function in bytes.
long long Long integers. The actual size can be obtained with the size(a long variable) function in bytes.
float double Floats (these are actually represented as doubles).
double double Double-precision floating-point numbers.
string std::string String datatype, with maximum length depending on the implementation (can be very large).
date time_t Timestamp with only the date part.
time time_t Timestamp with only the time part.
timestamp time_t Full timestamp including date and time.
bool int Boolean values represented as 0 (false) or 1 (true).
JSON nlohman::json Structured data on JSON format (v 1.7.0.x)
XML internal structural data Structured data on XML format (v 1.7.0.x)

Operands

Operands are values or variables operated on by operators to produce a result. Here are the operators available in ACF, along with their left and right operand types and the resulting data type:

Operator Left Type Right Type Result Type Description
+, -, * Numeric Types Numeric Types Float, Long, Int Basic arithmetic operations.
/ Int, Long, Float Int, Long, Float Float Division always results in a float.
++ Numeric Types - Same Increment left operand by one.
-- Numeric Types - Same Decrement left operand by one.
+ String All String Concatenate strings or convert non-string values to strings and concatenate.
+ Date Numeric Date Add days to a date.
+ Time Numeric Time Add seconds to a time.
* String Int, Long String Repeat the left string right times.
^ Int, Long, Float Int, Long, Float Float Exponentiation (power).
&& Bool Bool Bool Logical AND.
|| Bool Bool Bool Logical OR.
== All All Bool Equal comparison.
< All All Bool Less than comparison or string alphabetical order.
> All All Bool Greater than comparison or string alphabetical order.
<= All All Bool Less than or equal comparison.
>= All All Bool Greater than or equal comparison.
!= All All Bool Not equal comparison.
All All Bool Not equal comparison (alternative syntax).

Priority of Operands

The priority of operands defines the order of evaluation in expressions. Higher-priority operands are evaluated first. To change the priority, you can use parentheses in expressions. A factor can be negated with a "-" symbol in front of it, or "!" for boolean types, affecting only the next factor in the evaluation. For negating an entire expression, you must use parentheses.

Example:

a = !a || b;

This negates "a" but not the entire expression. To negate the whole expression:

a = !(a || b);

Here's the priority list of operands, from highest to lowest:

  1. Power (^)
  2. Multiplication (*) and Division (/)
  3. Addition (+) and Subtraction (-)
  4. Comparison operators (<, >, <=, >=, ==, !=, ≠)
  5. Logical AND (&&)
  6. Logical OR (||)

Conversion between data types

Most declaration type names can also be used as type converter functions. Some conversions allow additional parameters to specify the format to be applied. Here are some examples.