Brian Dunning's FileMaker Custom Functions

EvaluateRecursively ( expression )

Evaluates expression recursively as a calculation.

  Be the first to rate this function Log in to vote

Marcus Nilsson   Marcus Nilsson - Show more from this author
Square Moon
https://www.squaremoon.se/

Share on Facebook Share on Twitter

  Sample input:
EvaluateRecursively ( Quote ( TableName::FieldName ) )
  Sample output:
GetField ( "TableName::FieldName" )

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

/**
* ==================================================================
* EvaluateRecursively ( expression )
*
* PARAMETERS:
* expression - any text expression or text field
* RETURNS:
* text, number, date, time, timestamp, container
* EXAMPLE:
* EvaluateRecursively ( "Hello world!" ) = "Hello world!"
* EvaluateRecursively ( TableName::FieldName ) = GetField ( "TableName::FieldName" )
* EvaluateRecursively ( Quote ( TableName::FieldName ) ) = GetField ( "TableName::FieldName" )
* EvaluateRecursively ( "Let ( $var = " & Quote ( "Hello world!" ) & " ; $var )" ) & " " & $var = "Hello world! Hello world!"
* DEPENDENCIES:
* None
* AUTHOR:
* Marcus Nilsson, Square Moon, marcus@squaremoon.se
* PURPOSE:
* Evaluates expression recursively as a calculation.
* NOTES:
* None
* REVISIONS:
* 2021-10-27, Marcus Nilsson. Created.
* ==================================================================
*
*/

Let (
[
~expression = expression
] ;
If ( IsValidExpression ( ~expression ) ;
If ( Position ( ~expression ; "::" ; 1 ; 1 ) = 0 ;
Evaluate ( ~expression ) ;

EvaluateRecursively ( Evaluate ( ~expression ) )
) ;

~expression
)
)

 

Comments

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 16 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: