hat jemand "TStExpression" schon mal benutzt?
weiss jemand, wie die Funktion "AddFunction1Param" geht
Delphi-Quellcode:
function Mycos(Value:TStFloat): TStFloat;
begin
result := Cos(value);
end;
procedure TForm1.Button1Click(Sender: TObject);
var
mystring : String;
//Value : TStFloat;
begin
StExpression1.AddFunction1Param('cos',Mycos);
StExpression1.AddConstant('r',0.10);
StExpression1.Expression := Memo1.Lines.Text;
mystring := StExpression1.Expression;
while Pos(#$D#$A,mystring) > 0 do begin
Delete(mystring,Pos(#$D#$A,mystring),2);
end;
//Memo1.Lines.Clear;
Memo1.Lines.Text := floattostr(StExpression1.AnalyzeExpression);
StExpression1.GetIdentList(ListBox1.Items);
end;
[Fehler]: inkompatible Typen "Regulär Prozedur und Methodenzeiger"