[fpc-devel] TShiftState as enum

Jose Manuel qkysoft at arrakis.es
Fri Feb 18 00:41:18 CET 2005



>
> Can somebody enlighten me, what code exactly fails in D6?
> What extension does FPC have, that Delphi doesn't have?
>
> And what "iteration" is desired? I'd use: For Low(x) To High(x)...

>
> Let me add some more notes, regarding Delphi compatibility:
>
> Older Delphi (and TP?) versions implemented sets of subranges (e.g. set
> of 510..515)

i don't want to become heavy, but a subrange it's a subrange and a set is a
set.
If you'd use Low() and High(), your treating a set as if it were an array,
that can be handy sometimes, but strictly speaking, a set has no lower or
higher elements.
As far as I can remember, in TP, sets were represented with a single byte,
that is, the 255 bits were on or off (1 or 0) and represented the existance
or the lack of it in the set.
AFAICK, you can check for a determinate value in a set, but you can't
"navigate" through it as if it were an array. OK, you can use Boolean
operators (Union, Intersection, Rest...) and the Include, Exclude functions,
etc..., if you feel more comfortable. But there's no firt element, there are
no repeated elements, etc... It's a set

> AFAIR D6 introduced "open" enums, with arbitrary (discontinuous...)
> values for the members. IMO this only is an attempt to closer reflect C
> enums, but sets of such enumerated types are not allowed.

That's right. Enumerated open types (C-alike), such as (GREY=14, RED,
BLUE=21, ...) were introduced in D6, but anyway don?t have nothing to do
with sets.
>
>
> I do not ask for any compatibility in these cases, in detail when the
> Delphi implementation differs amongst compiler versions.

I really don't know, but I guess you are right, it must be a compiler
dependence.

JMR






More information about the fpc-devel mailing list