Recent

Author Topic: How can I know if my property is of TDateTime type in r-time  (Read 4320 times)

p_evghenii

  • Guest
How can I know if my property is of TDateTime type in r-time
« on: November 24, 2004, 09:47:31 am »
This code works pretty good in Delphi, but not in Lazarus:

if GetPropInfo(self, PropName).PropType^ = TypeInfo(TDateTime) then

Anonymous

  • Guest
How can I know if my property is of TDateTime type in r-time
« Reply #1 on: November 26, 2004, 12:50:43 pm »
I think you should try the following code, but I'm not sure it's the one you want:

if (self is TDateTime) then

p_evghenii

  • Guest
How can I know if my property is of TDateTime type in r-time
« Reply #2 on: November 26, 2004, 03:09:54 pm »
No, this code is not the one I need.

I have a number of properties of my object (self). I want to determine the type of my properties. It is easy to determine integers, strings etc. But there is no special method in typinfo to determine whether my property is TDateTime - I can find out that it is double (which in fact the TDateTime is) but I don't know whether it is double or TDateTime.

 

TinyPortal © 2005-2018