If you do not allow clients of your unit to define new elements or
change the set values, and what you want to do is prevent, say,
accidentally adding an extended element to the set in the base class,
you can declare extended elements as class-local constants.  Otherwise
you will need to add checks in property setters.

On Fri, Dec 28, 2012 at 7:33 PM, Mark Morgan Lloyd
<markmll.fpc-pas...@telemetry.co.uk> wrote:
> JC Chu wrote:
>>
>> It is not possible to extend an enumeration type.  If you are not
>> willing to use separate sets to hold common and extended elements, you
>> can use a generic (not parametric) set type, say SET OF 0..31, that
>> can hold all possible elements, and define the possible elements as
>> constants.
>
>
> Yes, except that that loses type checking.
>
>
> --
> Mark Morgan Lloyd
> markMLl .AT. telemetry.co .DOT. uk
>
> [Opinions above are the author's, not those of his employers or colleagues]
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal



-- 
Best regards,
JC Chu
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to