Re: [fpc-devel] TShiftState as enum

2005-02-17 Thread Mattias Gaertner
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 = set of

Re: [fpc-devel] TShiftState as enum

2005-02-17 Thread Marco van de Voort
[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! (But

Re: [fpc-devel] TShiftState as enum

2005-02-17 Thread Nikolay Nikolov
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,

Re: [fpc-devel] Abbrevia and Delphi compatibility

2005-02-17 Thread DrDiettrich
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 features to FPC,

Re: [fpc-devel] Abbrevia and Delphi compatibility

2005-02-17 Thread DrDiettrich
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 sufficient

Re: [fpc-devel] TShiftState as enum

2005-02-17 Thread DrDiettrich
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 is possible. It requires some

RE: [fpc-devel] TShiftState as enum

2005-02-17 Thread Jose Manuel
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

Re: [fpc-devel] TShiftState as enum

2005-02-17 Thread Peter Vreman
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 versions

Re: [fpc-devel] TShiftState as enum

2005-02-17 Thread Marco van de Voort
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