Elements 2513 and 2521: Setting enum value from String

One further hac.workaroud rtf make this easier might be:

type 
{$IFDEF JAVA}
  EnumBase = public java.lang.Enum;
{$ELSE}
  EnumBase = Int32;
{$ENDIF}
  Myenum = public enum (a,b,c) of EnumBase;

this way, you only need an ifdef in one place, for the base type. still ugly, I agree, but better.