Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi TStExpression problem!!! (https://www.delphipraxis.net/88041-tstexpression-problem.html)

allen928cn 9. Mär 2007 09:59


TStExpression problem!!!
 
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"


Alle Zeitangaben in WEZ +1. Es ist jetzt 13:03 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz