Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2006-07

RTTI difference

4 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Leonardo M. Ram�

I found a difference between the TPropInfo record GetProc and SetProc pointers between Delphi and FPC, when i check a class like this:

type
  TMyClass = class(TPersistent)
  private
    FAttrib1: Integer;
  published
    property Attrib: Integer read FAttrib write FAttrib;
  end;

In Delphi, when i do GetPropInfo(TMyClass, Attrib)^.GetProc it gives a nil value, right, because i don´t have declared a getter for this property, with SetProc is the same.

In FPC, the results never are nil. Is this the correct behavior, or is a bug?

Leonardo M. Ramé
http://leonardorame.blogspot.com

__________________________________________________ Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com

Reply by email

Graeme Geldenhuys
to Leonardo M. Ram�

Hi,

I have found that same issue a couple months back. I think I reported it as a bug, I will double check. What I had to do under FPC to get it working was the following:

    {$IFDEF FPC}
    result    := (lPropInfo^.GetProc  Pointer($01)) and
(lPropInfo^.SetProc  Pointer($01));
    {$ELSE}
    result    := ( lPropInfo^.GetProc  nil ) and (
lPropInfo^.SetProc  nil ) ;
    {$ENDIF}

Regards,
Graeme.

Leonardo M. Ramé wrote 28 lines
I found a difference between the TPropInfo record GetProc and SetProc pointers between Delphi and FPC, when i check a class like this: type TMyClass = class(TPersistent) private FAttrib1: Integer; published property Attrib: Integer read FAttrib write FAttrib; end; In Delphi, when i do GetPropInfo(TMyClass, Attrib)^.GetProc it gives a nil value, right, because i don´t have declared a getter for this property, with SetProc is the same. In FPC, the results never are nil. Is this the correct behavior, or is a bug? Leonardo M. Ramé http://leonardorame.blogspot.com __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel
There's no place like 127.0.0.1

Reply by email

Graeme Geldenhuys
to Leonardo M. Ram�: I found a difference between the TPropInfo record GetProc and SetProc pointers between…

Umm.. It seems I never reported that bug (I couldn't find it in Mantis). :-(

I have reported it now as Issue 7187

http://www.freepascal.org/mantis/view.php?id=7187

Regards,
Graeme.

Leonardo M. Ramé wrote 28 lines
I found a difference between the TPropInfo record GetProc and SetProc pointers between Delphi and FPC, when i check a class like this: type TMyClass = class(TPersistent) private FAttrib1: Integer; published property Attrib: Integer read FAttrib write FAttrib; end; In Delphi, when i do GetPropInfo(TMyClass, Attrib)^.GetProc it gives a nil value, right, because i don´t have declared a getter for this property, with SetProc is the same. In FPC, the results never are nil. Is this the correct behavior, or is a bug? Leonardo M. Ramé http://leonardorame.blogspot.com __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel
There's no place like 127.0.0.1

Reply by email

Leonardo M. Ram�
to Graeme Geldenhuys

Thanks Graeme,
it's amazing the speed of response on this mailing list. Congrats to the freepascal community!

--- Graeme Geldenhuys wrote 49 lines
Umm.. It seems I never reported that bug (I couldn't find it in Mantis). :-( I have reported it now as Issue 7187 http://www.freepascal.org/mantis/view.php?id=7187 Regards, Graeme. On 7/21/06, Leonardo M. Ramé wrote: > I found a difference between the TPropInfo record GetProc and SetProc pointers between Delphi and > FPC, when i check a class like this: > > type > TMyClass = class(TPersistent) > private > FAttrib1: Integer; > published > property Attrib: Integer read FAttrib write FAttrib; > end; > > In Delphi, when i do GetPropInfo(TMyClass, Attrib)^.GetProc it gives a nil value, right, because i > don´t have declared a getter for this property, with SetProc is the same. > > In FPC, the results never are nil. Is this the correct behavior, or is a bug? > > > Leonardo M. Ramé > http://leonardorame.blogspot.com > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > _______________________________________________ > fpc-devel maillist - > http://lists.freepascal.org/mailman/listinfo/fpc-devel > -- There's no place like 127.0.0.1 > _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Leonardo M. Ramé
http://leonardorame.blogspot.com

__________________________________________________ Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com

Reply by email