I have a unit that is compiling in DELPHI mode
but now wanted to change it to OBJFPC mode
(in DELPHI mode I cannot use binary constants %10011100).

But OBJFPC mode I get an "illegal type conversion" with the following code:

---------------------------------------------------------------
type FlagType        = (Flag1,Flag2);
         FlagSetType   = set of FlagType;
var i : SizeInt;
      S : FlagSetTyp;

S := [Flag1];
i := byte(S); // <---- Error "illegal type conversion"
---------------------------------------------------------------

Any idea how to convince the compiler to typecast
the set to byte in OBJFPC mode too?

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to