Mega Code Archive

 
Categories / Delphi / Examples
 

How to determine a property type

How to tell what type a property is. var PropInfo: PPropInfo; Info: PTypeInfo; begin PropInfo := GetPropInfo(Self, 'Test'); if PropInfo = nil then Exit; if PropInfo^.PropType^ = TypeInfo(TDateTime) then ShowMessage('Hello'); end;