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;

 

Share this article!

Follow us!

Find more helpful articles: