Autor Beitrag
zero_cool1986
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 95

MS DOS ;)
D6
BeitragVerfasst: Sa 19.01.08 13:09 
Hallihalo, liebe Comunity, ich hab wieder mal eine simple Frage, und hab nix gefunden im Forum,
ich möchte ein Ereigniss aufrufen, wenn mehrere Vorgaben erfüllt sind, aber das klappt irgendwie nicht
folgendes:

if a=33;
and
b=44;
and
c=99;
and
d=88
then

e:=2;

so in der Art...


Moderiert von user profile iconChristian S.: Topic aus Sonstiges (Delphi) verschoben am Sa 19.01.2008 um 13:46
LorenzS
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 128

MS-DOS, WIN 7, WIN 10
BP7.0, D3, D5
BeitragVerfasst: Sa 19.01.08 13:14 
innerhalb in der bedingung dürfen keien ; (semikolons) sein.
richtig wäre:
ausblenden Delphi-Quelltext
1:
2:
if a=33 and b=44 and c=99 and d=88 then 
 e:=2;

bzw.
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
if a=33 and 
   b=44 and 
   c=99 and 
   d=88 then 
 e:=2;
nagel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 708

Win7, Ubuntu 10.10

BeitragVerfasst: Sa 19.01.08 13:15 
ausblenden Delphi-Quelltext
1:
If (a = 33) And (b = 44) And (c = 99) And (d = 88) Then e := 2;					
Mitmischer 1703
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 754
Erhaltene Danke: 19

Win 7, Debian
Delphi Prism, Delphi 7, RAD Studio 2009 Academic, C#, C++, Java, HTML, PHP
BeitragVerfasst: Sa 19.01.08 13:15 
ausblenden Delphi-Quelltext
1:
2:
if (d = x) and (f = x) and (x=y) then
//....

Och manno, @nagel :explode:

_________________
Die Lösung ist nicht siebzehn.
Chryzler
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1097
Erhaltene Danke: 2



BeitragVerfasst: Sa 19.01.08 14:03 
Auch möglich ist folgende Variante, die bereits gezeigte würde ich aber immer vorziehen.
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
if a = 33 then
  if b = 44 then
    if c = 99 then
      if d = 88 then
        e := 2;