I'm encoding a set type and a number into a (32-bit) Tag property. Retrieving the set from the Tag is trivial: TDaySet(Byte((tag and $ff000000) shr 24))
. But how can I set up constants containing this encoded set information?
const
FRED_SCHEDULE = ID_FRED or (Byte([Monday, Wednesday]) shl 24);
This doesn't compile. The actual error is "Invalid typecast" but I think the fundamental problem is that I'm trying to initialize a non-typed constant from a typed constant.
Has anyone a better idea?