Autor Beitrag
Dezipaitor
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 220



BeitragVerfasst: So 15.06.03 00:08 
ich habe folgendes problem
und zwar muss der folgende ausdruck aus einer textdatei ausgewertet werden:

EineKonstante = irgendwas

(EineKonstante >= 2.0) -> TRUE oder FALSE

das auslesen der symbole
einekonstante
>
=
2.0
ist schon möglich

nur wie kann ich den ausdruck auf TRUE oder FALSE auswerten?

ich habe leider nichts vergleichbares gefunden

thx
Ex0rzist
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 550

Win XP Prof.
Mandrake 10.0

D6
BeitragVerfasst: So 15.06.03 01:28 
Wenn ich dich richtig verstanden habe, hilft dir dieser Codeschnipsel (nur ein Beispiel) weiter:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
procedure TForm1.Button1Click(Sender: TObject);
var Wahr: Boolean;
begin
If Lowercase(Edit1.Text) = 'true' then
    Wahr := true;
If Lowercase(Edit1.Text) = 'false' then
    Wahr := False;
If ( StrToInt(Edit2.Text) > StrToInt(Edit3.Text) = Wahr ) then
 Showmessage('Die Aussage ist wahr!')
 else
  Showmessage('Die Aussage ist falsch!');
end;

_________________
If accidentally read, induce vomitting.
Dezipaitor Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 220



BeitragVerfasst: So 15.06.03 17:39 
das funktioniert irgendwie nicht,

schließlich gibt es mehrere vergleichsoperatoren die auch kombiniert werden können:

<
>
=
AndyB
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1173
Erhaltene Danke: 14


RAD Studio XE2
BeitragVerfasst: So 15.06.03 18:29 
Dezipaitor hat folgendes geschrieben:
ich habe leider nichts vergleichbares gefunden

Du sollst es auch nicht suchen, sondern programmieren.

_________________
Ist Zeit wirklich Geld?
Dezipaitor Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 220



BeitragVerfasst: So 15.06.03 18:32 
ich habe damit auch threads aus dem board gemeint.

was ich brauche ist auch nur ein ansatz.
toms
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1099
Erhaltene Danke: 2



BeitragVerfasst: So 15.06.03 18:34 
Einekonstante (K1)
Operator (Op)

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
function Eval(K1: Extended; Op: String): Boolean;
begin
  if Op = '=' then Result := K1 = 2.0 else
  if Op = '>' then Result := K1 > 2.0 else
  if Op = '<' then Result := K1 < 2.0 else
  if Op = '>=' then Result := K1 >= 2.0 else
  if Op = '<=' then Result := K1 <= 2.0
end;