Autor Beitrag
lord.paddington
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 76



BeitragVerfasst: Mi 28.09.05 21:27 
Hi!

Wie lautet denn die korrekte ODER Abfrage im folgenden Quelltext

i
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
f Month = 1 OR 4 OR 7 OR 10 then
             begin
               showmessage('QUARTAL');
               exportieren;
             end;


Moderiert von user profile iconKlabautermann: Delphi-Tags hinzugefügt.

_________________
pfutsch ist hin und hin ist pfutsch
ManuelGS
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 173

Win XP HE, Suse Linux
D6, D7, D2005 Personal
BeitragVerfasst: Mi 28.09.05 21:33 
Das was du da machst ist eine Bit-Verknüpfung von Zahlen.

Lösungen gibt's da mehrere.
Entweder
ausblenden Delphi-Quelltext
1:
if (zahl=4) or (zahl=3) or (zahl=7) then ...					

oder
ausblenden Delphi-Quelltext
1:
2:
3:
case zahl of
  1,3,7: begin machetwas; machetwas2; end;
  end;


Das sind wohl die einfachsten Möglichkeiten.

_________________
"Leben ist gänzlich Bühne und Spiel; so lerne denn spielen
und entsage dem Ernst - oder erdulde das Leid." - Palladas von Alexandria
Kokel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 79

XP Prof
delphi 2006 Prof.
BeitragVerfasst: Mi 28.09.05 21:38 
ausblenden Delphi-Quelltext
1:
if  (month=1) or (month=4) or (month=7) or (month=10) then ...					
Klabautermann
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Veteran
Beiträge: 6366
Erhaltene Danke: 60

Windows 7, Ubuntu
Delphi 7 Prof.
BeitragVerfasst: Mi 28.09.05 21:39 
Hallo,

ausblenden Delphi-Quelltext
1:
if (zahl in [4, 3, 7]) then					


sollte auch gut funktionieren.

Gruß
Klabautermann