Autor Beitrag
benjamin_200
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 19



BeitragVerfasst: Di 16.09.08 18:52 
hallo,

ich möchte gerne eine Bedingung schreiben die sich auf mehrere veriablen bezieht.
meiner meinung nach funktioniert das mit AND aber mein delphi 6 sagt mir fehler:-P

kann mir jemand helfen?

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
procedure TForm1.Button5Click(Sender: TObject);
var p1,p2,p3,p4: real;

begin
p1:= strtofloat( punkt1.text);
p2:= strtofloat ( punkt2.text) ;
p3:= strtofloat( punkt3.Text);
p4:= strtofloat( punkt3.text);

if p1 > p2 and p1 > p3 then rang1.text:= edit1.text;


beim AND zeigt er :Operator not applicable to this operand type

vielen dank schonma

Moderiert von user profile iconGausi: Delphi-Tags hinzugefügt
Moderiert von user profile iconGausi: Topic aus Job Börse verschoben am Di 16.09.2008 um 19:02
Timosch
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1314

Debian Squeeze, Win 7 Prof.
D7 Pers
BeitragVerfasst: Di 16.09.08 18:57 
1.) Delphi-Tags verwenden!
2.) Setz mal eine Klammer um die Bedingungen, also:
ausblenden Delphi-Quelltext
1:
if (p1>p2)and(p1>p3) then					

Dann müsste es gehen.

_________________
If liberty means anything at all, it means the right to tell people what they do not want to hear. - George Orwell
benjamin_200 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 19



BeitragVerfasst: Di 16.09.08 19:00 
alles klar.
vielen dank und das nächste mal natürlich mit tags.
j.klugmann
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Di 16.09.08 19:01 
Das gehörtnicht in die Job-Börse oder bist du bereit etwas zu bezahlen?
Setze es in delphi language.
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
procedure TForm1.Button5Click(Sender: TObject);
var p1,p2,p3,p4: real;
begin
  p1:= strtofloat( punkt1.text);
  p2:= strtofloat ( punkt2.text) ;
  p3:= strtofloat( punkt3.Text);
  p4:= strtofloat( punkt3.text);

  if (p1 > p2) and (p1 > p3) then rang1.text:= edit1.text; 
end;

Edit:Mist war zu langsam!