fm_evaluate
fm_evaluate
mixed fm_evaluate ( string $expression
)
Description
Evaluates expression
using FileMaker’s calculation engine.
Parameters
expression
(required)
Any expression that can be used with FileMaker’s Evaluate function.
Return
Returns the result from FileMaker, converted to the matching PHP type as follows:
FileMaker Type | PHP Type | Notes |
---|---|---|
text | string | |
number | double | Both integer and decimal numbers are converted to double. Note that decimal values are rounded to 13 places, for example, if you evaluate Pi as the expression, the returned value will be 3.1415926535898 (13 places), however, if you evaluate Pi directly with FileMaker, the returned value will be 3.1415926535897932 (16 places). |
date | string | A date string formatted using the SQL 92 syntax: YYYY-MM-DD. |
time | string | A time string formatted using the SQL 92 syntax: HH:MM:SS or HH:MM:SS.UUU if the value is stored with microtime values. |
timestamp | string | A timestamp string formatted using the SQL 92 syntax: YYYY-MM-DD HH:MM:SS or YYYY-MM-DD HH:MM:SS.UUU if the value is stored with microtime values. |
container (stored) | array | Special PHP container array that allows you to access container data within PHP. |
container (referenced or remote) | string | The name and path of the file. |
Errors
Will return ? if the
expression
is not valid.
Example 1 - Get application version
echo fm_evaluate('Get ( ApplicationVersion )'); /* Returns: ProAdvanced 14.0.2 */
Change Log
Version | Description |
---|---|
3.0.0 | Function now supports containers and returns mixed instead of string. Return values are converted to the matching PHP type. |
, multiple selections available,
Related content
fm_get_parameter
fm_get_parameter
More like this
fm_set_variable
fm_set_variable
More like this
fm_sql_select
fm_sql_select
More like this
fm_sql_select_ex
fm_sql_select_ex
More like this
fm_save_file
fm_save_file
More like this
PHP_Execute
PHP_Execute
More like this