TMtxFunctionEvaluator Class

ComponentTMtxComponentTMtxFunctionEvaluator

type TMtxFunctionEvaluator = class(TMtxComponent);

Function evaluator.

The component offers a simple interface to evaluate expressions.

The expressions are assigned to the TMtxFunctionEvaluator.Context property and are compiled, prepared for execution and stored in the TMtxFunctionEvaluator.Expressions property. The expression parser can handle real and complex numbers, logical variables, variable assignments and more. The expression engine is fully customizable supporting user defined variables and functions.

To evalute the expression(s) in the TMtxFunctionEvaluator.Context property again, set the TMtxFunctionEvaluator.Context property again or call the TMtxFunctionEvaluator.Recalculate method. In either case the expression will not be parsed again, just evaluated once more.

Properties

NameTypeDescription
BlockAssignBooleanBlock streaming of specific properties when storing only a "template".
ContextTExprContextExpression context.
EditorActiveBooleanReturns True, if the component editor is displayed.
ExpressionsTMtxExpressionReturns the compiled expressions from the TMtxFunctionEvaluator.Context class.
ReferenceTReferenceListStores a list of components that have to be notified, when this component is destroyed.
ResultAsStringstringReturns the result of evaluation as string.

Methods

NameDescription
AllowStreamingReturns the negatated value of BlockAssign.
AssignAssign values of all published properties from Source.
AssignTemplateAssign values of "template-like" published properties from Source.
EditorClassTo be overriden in descendanr classses.
LoadFromStreamLoad the component from Src stream.
LoadTemplateFromFileLoad a template from file.
LoadTemplateFromStreamLoad a template from stream.
RecalculateRe-evaluates expression in Context.
ResetReset is called after loading the data from stream or file.
SaveTemplateToFileSave template to file.
SaveTemplateToStreamSave template to stream.
SaveToStreamSave the component to Dst stream.