EvaluationError()
Category: Logical
Syntax: EvaluationError ( expression ) |
Parameters:
expressionAny FileMaker calculation formula.
Data type returned: Number
Description:
Returns whatever error code an expression may generate if executed. If the expression executes properly, a zero (no error) will be returned.
Note that the expression is executed if it is syntactically correct. If your expression manipulates local or global variables, they will be affected by this EvaluationError() check. Note also that there are two kinds of errors returned: syntax errors, where the expression cannot be executed (and will not be executed by EvalutionError()), and runtime errors, where the expression is valid but, for example, a field or record may be missing.
Important: The EvaluationError() function must enclose the Evaluate() function to return any syntax errors.
Examples:
Function |
Results |
---|---|
EvaluationError ( Evaluate ( Length ( ))) |
Returns error 102 (field missing). |
EvaluationError ( Evaluate ( Case ( 1 = 1 )) |
Returns error 1201 (too few parameters). |
EvaluationError ( Case ( 1 = 1 )) |
Returns error 0 since there were no runtime errors. If you want to ensure you always get error codes including this syntax error, be sure to use the nested Evaluate() function. Note that this error is impossible to get unless you're working with calculation formulas in fields: If you were to enter this example into a calculation dialog, FileMaker would not allow it to be saved and would prompt the developer to correct the syntax. |