Myles wrote:

> If you know the first value in a Set you could use a combination of ORD,
> and PRED
> Count := ORD( PRED( FirstValue )) - ORD( FirstValue)+ 1;
> You would probably have to use RTTI  to get the first element.

1. To this hot brain, that looks invalid -- pred(FirstValue) should 
be undefined. Do you perhaps mean pred(ord(firstvalue))? Or 
maybe I misunderstand what's needed, so ignore and read on.  

2. I've forgotten the question so I may be at a disadvantage but:

a) If it's to find out the position in a list, won't simply ord(x) do?

b) If it's to find out the count won't  ord(high(setname))  do?

Mustn't forget the low() and high() operators, they can be really 
handy in this kind of case...


Peter Hyde, SPIS Ltd, Christchurch, New Zealand 
* TurboNote:
  -- small, FREE and very handy
* Print-to-Web automation
* Web design, automation and hosting specialists
Find all the above and MORE at
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]

Reply via email to