Autor Beitrag
Sors
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 47

Win XP
D7 Prof
BeitragVerfasst: Fr 10.09.04 17:44 
Also neues Problem:

Ich habe eine mathematische Funktion als STRING in einem Editfeld (z.B. 3*x^2+4), nun soll mein Programm das x durch eine Zahl (ebenfalls STRING), die ich vorgebe ersetzen (z.B. durch die Zahl 5, sodass 3*x^2+4 --> 3*5^2+4) und dann soll dieser String ausgerechnet werden und jetzt als Gleitkommazahl an eine Variable vom Typ Long übergeben werden.

Wie realisiere ich das?

Danke im Vorraus.


Moderiert von user profile iconChristian S.: Topic aus VCL (Visual Component Library) verschoben am Fr 10.09.2004 um 18:49
Sprint
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 849



BeitragVerfasst: Fr 10.09.04 18:00 
Entweder du durchsuchst den String mit Pos und ersetzt das Zeichen selbst oder du benutzt AnsiReplaceStr.

_________________
Ciao, Sprint.
Sors Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 47

Win XP
D7 Prof
BeitragVerfasst: Sa 11.09.04 14:09 
Danke, das Ersetzen hat Funktioniert.

Jedoch soll jetzt die Funktion ausgerechnet werden. Gibt es irgendwie eine Funktion die einen String ausrechnen kann?
Keldorn
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 2266
Erhaltene Danke: 4

Vista
D6 Prof, D 2005 Pro, D2007 Pro, DelphiXE2 Pro
BeitragVerfasst: Sa 11.09.04 14:18 
Suche in: Delphi-Forum, Delphi-Library PARSER

Mfg Frank

_________________
Lükes Grundlage der Programmierung: Es wird nicht funktionieren.
(Murphy)