{$mode delphi}
type aenum=510..517;
aset = set of aenum;
begin
Writeln(sizeof(aset));
end.
xbla.pp(5,25) Error: illegal type declaration of set elements
xbla.pp(10,4) Fatal: There were 1 errors compiling module, stopping
Delphi dowsn't allow sets with ordinal values larger than 255 too:
Borlan
> > Older Delphi (and TP?) versions implemented sets of subranges (e.g. set
> > of 510..515) by "stripping" unused bytes in front of the set. The lowest
> > bit in a set variable always had an ordinal value of 2^n, and above set
> > would occupy 2 bytes, equaling an set of (504..519). In newer Delp
> Older Delphi (and TP?) versions implemented sets of subranges (e.g. set
> of 510..515) by "stripping" unused bytes in front of the set. The lowest
> bit in a set variable always had an ordinal value of 2^n, and above set
> would occupy 2 bytes, equaling an set of (504..519). In newer Delphi
> ver
>
> 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 imple
Marco van de Voort wrote:
>
> > > TShiftState is defined as TShiftState = set of (...);
> > >
> > > How can I iterate through the enums? If not, can we split and add an
> > > enum:
> > >
> > > TShiftStateEnum = (...)
> > > TShiftState = set of TShiftStateEnum;
> > >
> > > ?
> >
> > Of course that
Peter Vreman wrote:
> > 1) Properties for Object type.
>
> Since which Delphi version is a property allowed in an normal object?
I'm not sure, but at least D4 supports such properties.
> Currently FPC has special code that forbids property in objects for delphi
> mode.
Then it would be suffici
Marco van de Voort wrote:
>
> > 2) Sets with minimal size, at least with 1 and 2 bytes for replacement
> > of Byte and Word types.
> >
> > I consider both features as vital in translations from C to Pascal, and
> > in the detection and elimination of bugs. Will it be possible to add
> > these feat
> Jose Manuel wrote:
>
> >I think sets are sets and enumerated types are enumerated types,
> and Pascal
> >is Pascal-
> >
> >
> Ok, but in pascal the elements in a set can only be of ordered
> type anyway.
Yes, of course. Maybe I haven't explained myself. Indeed, and you are quite
right you'got to
Jose Manuel wrote:
Well, sets are by definition a kind of bag. No enumeration or any kind of
order are suited to sets.
Can be handy, I agree, under certain situations, but then we are getting
back to C.
I think sets are sets and enumerated types are enumerated types, and Pascal
is Pascal-
Ok, bu
> > >
> > > > TShiftStateEnum = (...)
> > > > TShiftState = set of TShiftStateEnum;
> > > >
> > > > ?
> > >
> > > Of course that is possible. It requires some imagination though (and
> > > a feel for obfuscated Pascal)
> >
> >
> > The example fails in Delphi 6 btw, but works in FPC :-)
>
> Intere
> [EMAIL PROTECTED] (Marco van de Voort) wrote:
> >
> > The example fails in Delphi 6 btw, but works in FPC :-)
>
> Interesting :)
Yeah, D2005 for IN syntax is also useful for this (if it operates on sets)
> But in this case: why not simply add one line to classes.pp?
That is not as much fun!
On Thursday 17 February 2005 07:37, Marco van de Voort wrote:
> type myset = set of ( a1,a2,a3,a4,a5,a6);
>
> // workaround types
> const
> beginmyset=ord(low(myset));
> endmyset=ord(high(myset));
> type
> uglyenum = beginmyset..endmyset;
> uglyset= set of uglyenum;
>
> var b :
On Thu, 17 Feb 2005 08:58:01 +0100 (CET)
[EMAIL PROTECTED] (Marco van de Voort) wrote:
> > > TShiftState is defined as TShiftState = set of (...);
> > >
> > > How can I iterate through the enums? If not, can we split and add
> > > an enum:
> > >
> > > TShiftStateEnum = (...)
> > > TShiftState =
13 matches
Mail list logo