[fpc-devel] How to convert set to integer and vice versay

Marco van de Voort marcov at stack.nl
Wed Jul 23 00:01:35 CEST 2014


In our previous episode, Gennady Agranov said:
> Your example does compile, but if you replace 31 with 32 - it will not
> compile - no matter what you use - integer, int64 or qword

But does that work in Delphi, did you test?
 
> And I guess I know the reason now - sizeof(left) should be equal to
> sizeof(right) and 33 bits enum has sizeof of 5 :(

Correct.

> Any suggestions?

Define using $packenum/$packset, or simply using a range 0..63.



More information about the fpc-devel mailing list