procedure TForm1.Button1Click(Sender: TObject);
Type
MySet = (chris, john, bob, mary, fred, pam);
MyXSet = set of MySet;
Var
y : MyXSet;
j : Integer;
Size : Integer;
begin
y := [chris, pam, mary];
Size := 0;
for j := ord(Low(MySet)) to ord(high(MySet)) do // Iterate
if (MySet(j) in y) then
Inc(Size);
ShowMessage('size = '+Inttostr(Size));
end;
There is probally a better way..
Chris
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Neven MacEwan
Sent: Wednesday, 8 March 2000 3:58 p.m.
To: Multiple recipients of list delphi
Subject: [DUG]: Quantity of a Set
Hiya All
Can anyone really clever out there tell me how to work out what that
'Quantity' of a set memberhip is!
I want to resize a navigator depending on how many buttons are visible
TIA
Regards Neven
N.K. MacEwan B.E. E&E
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz