[fpc-devel] GetEnumValue result type

Hans-Peter Diettrich DrDiettrich1 at aol.com
Mon Apr 18 23:37:31 CEST 2011


Leonardo M. Ramé schrieb:

> TMyType = (mtOne, mtTwo, mtThree);
> 
> var lMyType: TMyType;
> 
> begin lMyType := TMyType(GetEnumValue(TypeInfo(TMyType), 'mtTwo')); 
> // lMyType is 1 instead of "mtTwo"

How do you know? Since ord(mtTwo)=1, you seem to be fooled by the debugger.

DoDi




More information about the fpc-devel mailing list