Frank Heckenbach wrote:
In the CarbonEvents.pas unit, we could write something like this:
const kEventParamMenuRef : FourCharCode = 'menu'; kEventParamMenuRefWord = Word32( kEventParamMenuRef);
Now, you can use "kEventParamMenuRefWord" in case statements.
Oops. This actually shouldn't work I think. (kEventParamMenuRef is not ordinal, so a value type cast doesn't apply, and a variable type cast shouldn't be usable for a constant value.) So I'll probably forbid it in the next version.
It doesn't make the task of working with FourCharCode types easier. What about a built-in function (instead of a macro) that converts a FourCharCode type into a 32-bit Cardinal, e.g.
Const kEventParamMenuRef = FourCharOrd( 'menu');
or
Const kEventParamMenuRef = Ord4( 'menu');
Regards,
Adriaan van Os