In our previous episode, Juha Manninen said: [ Charset ISO-8859-1 unsupported, converting... ] > If I have have a set with < 9 elements, like : > > type > TMyEnum = ( > xOne, > xTwo, > xThree, > xFour, > xFive > ); > // Count <= 8, fits in one Byte > TMyEnums = set of TMyEnum; > > then in Delphi a variable of that type can be casted to Byte. Other > casts don't work. > In FPC I must cast it to Integer!
Workse fine here: {$mode delphi} type TMyEnum = ( xOne, xTwo, xThree, xFour, xFive ); // Count <= 8, fits in one Byte TMyEnums = set of TMyEnum; var x :TMyenums; y : byte; begin y:=byte(x); end. Hint: if you want delphi compatibility, use {$mode delphi} :-) _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal