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...


cheers,
peter

==================================================
Peter Hyde, SPIS Ltd, Christchurch, New Zealand 
* TurboNote: http://TurboPress.com/tbnote.htm
  -- small, FREE and very handy
* Print-to-Web automation http://TurboPress.com
* Web design, automation and hosting specialists
Find all the above and MORE at http://www.spis.co.nz
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to