Autor Beitrag
Mr.Sing
Hält's aus hier
Beiträge: 2



BeitragVerfasst: Mi 07.06.06 14:32 
Ahoi,
da ich keinen Beitrag zu diesem Thema gefunden habe oder ein beispiel das mir weiterhilft und die Frage recht simpel ist wollt ich einfach fix mal fragen, ob es möglich ist mehrer boolean Werte hintereinander zu definieren... also nach dem Schema :
muh1,muh2,muh3:boolean;
bzw.
muh1,muh2,muh3:=true; oder muh1,muh2,muh3=true;

Das wars schon....
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Mi 07.06.06 14:35 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
var muh : array[1..3] of boolean;

for i := 0 to 3 do
begin
  muh[i]:=true;
end;

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
Mr.Sing Threadstarter
Hält's aus hier
Beiträge: 2



BeitragVerfasst: Mi 07.06.06 14:53 
Ups, hät man drauf kommen können ;)
Merci.
Robert_G
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 416


Delphi32 (D2005 PE); Chrome/C# (VS2003 E/A, VS2005)
BeitragVerfasst: Mi 07.06.06 15:03 
Oft ist es wesentlich hübscher das ganze mit Sets zu lösen:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
TSetting = (stBli, stBla, stBlubb);

TSettings = set of TSetting;
...

if stBlubb in settings then
  DoSomething();


Boolean sollte man IMHO mit Vorsicht genießen. Gerade für Parameter taugt es nicht viel, da man immer nachschlagen muss, was z.Bsp. ein true an der 3. Stelle bewirkt.