Autor Beitrag
crushead777
Hält's aus hier
Beiträge: 14



BeitragVerfasst: Mi 29.11.06 20:10 
Hi,
ich habe in etwa folgende Abfrage in meinem Programm:

ausblenden Delphi-Quelltext
1:
if a = 1 or a = 2 or a = ... or a = 10 then					

geht das nicht auch einfacher?
Vielen Dank

Moderiert von user profile iconChristian S.: Delphi-Tags hinzugefügt
Moderiert von user profile iconChristian S.: Topic aus VCL (Visual Component Library) verschoben am Mi 29.11.2006 um 20:23
AutopilotON
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 17

Win 98,ME,XP SP2,Suse 10.0
D6, TurboDelphi 2006
BeitragVerfasst: Mi 29.11.06 20:25 
also speziel dafür fällt mir dies ein:
ausblenden Delphi-Quelltext
1:
if a in [1..10] then ...					
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Mi 29.11.06 20:25 
Oder allgemeiner:
ausblenden Delphi-Quelltext
1:
if a in [1..10, 42, 44..89] then					

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Mi 29.11.06 20:28 
Eine weitere Möglichkeit wäre if (a >= 1) and (a <= 10) then

AXMD
crushead777 Threadstarter
Hält's aus hier
Beiträge: 14



BeitragVerfasst: Do 30.11.06 06:31 
Hey,
danke!! Auf das letzte hätte ich auch mal selber kommen können ;)
nochmals danke