CreateCustom(Text: String; Formula: String): ITerm;
Text - text of custom term.
Formula - formula of custom term.
The CreateCustom method creates a custom term.
It is impossible to edit text in the custom term as opposed to the literal one. Only whole custom term can be selected.
Executing the example requires a form, a button named Button1 on it and the TermEdit component named TermEdit1.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Terms: ITermList;
Te: ITerm;
i: Integer;
Begin
Terms := TermEdit1.Terms;
Te := Terms.CreateCustom("A", "@a");
i := TermEdit1.PutTerm(Te);
TermEdit1.Hyperlink(i) := True;
Te := Terms.CreateLiteral("+");
i := TermEdit1.PutTerm(Te);
Te := Terms.CreateCustom("B", "@b");
i := TermEdit1.PutTerm(Te);
TermEdit1.Hyperlink(i) := True;
End Sub Button1OnClick;
After executing the example clicking the button creates three terms for the TermEdit1 component. The expression is composed of them. The terms are displayed as the hyperlinks.
See also: