The subtle advantage to using Low and High is that there is potentially less
future code maintenance required if the enumeration changes...

Cheers,

C.

-----Original Message-----
From: Allan, Samuel [mailto:[EMAIL PROTECTED]]

try this

var
   bob: (A,C,B);
begin
   for bob := a to b do
   begin
      if bob = a then showmessage('a');
      if bob = b then showmessage('b');
      if bob = c then showmessage('c');
   end;
end;

It works for me

-----Original Message-----
From: Terry Johnson [mailto:[EMAIL PROTECTED]]

Suppose you have an enumeration like ...

type
    lights = (red,orange,green);

In Ada, you can write something like

for colour:=lights'first to lights'last do ...

where lights'first = red, and lights'last=green. Anything like this in 
Delphi? I've looked, but can't find anything...

Cheers,
Terry
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/

Reply via email to