Add(Name: String): IExpressionCategory;
Name. Name of the substitution category that should be created.
The Add method creates a new substitution category.
Executing the example requires a form that contains the Button component named Button1 and the MetaAttributesEdit component named MetaAttributesEdit1. The example is a handler of the OnClick event for the Button1 component.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Exp: IExpression;
Substs: IExpressionSubstitutions;
Cat: IExpressionCategory;
Begin
Exp := MetaAttributesEdit1.Expression;
Substs := Exp.Substitutions;
Cat := Substs.Add("MyCategory");
Cat.Add("Sin", "MathFin.Math.Sin");
Cat.Add("Cos", "MathFin.Math.Cos");
Cat.Add("Tan", "MathFin.Math.Tan");
Cat.Add("MyConst", "1354226.31131");
Cat.Add("MyFunc", "Module_1.MyFunc");
End Sub Button1OnClick;
After executing the example when the button is clicked, a new category containing five user substitutions is added to the list of substitutions of the expression linked to the MetaAttributesEdit1 component. While creating expressions, one can use abbreviations for the functions Sin, Cos, Tan of the MyFunc custom function contained in the Module_1 unit, and the specified constant. These abbreviations are available in IntelliSense of the component
See also: