Sign in Join

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

Mailing lists / fpc-devel / 2009-05

SetPropValue case sensitive

6 messages · 4 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 Delphi's SetPropValue function with its counterpart in FPC. In Delphi, this function is case insensitive, while in fpc it is case sensitive.

Am I correct?

Leonardo.

Reply by email

Sergei Gorelkin
to Leonardo M. Ramé
Leonardo M. Ramé wrote
I found a difference between Delphi's SetPropValue function with its counterpart in FPC. In Delphi, this function is case insensitive, while in fpc it is case sensitive. Am I correct?

The property name comparison (ending up in GetPropInfo(TypeInfo: PTypeInfo; const PropName: string),
rtl/objpas/typinfo.pp line 571) is done case-insensitive, unless there is a bug somewhere.
Can you provide code snippet illustrating the difference?

Sergei

Reply by email

Leonardo M. Ramé

I studied a little deeper and the problem is (according to FPC 2.2.2 manual) that SetPropValue doesn't work because Variants are not implemented yet.

The solution was easy, I used SetStrProp instead of SetPropValue. In my program all published properties were strings.

Can you confirm if it is implemented in newer versions?

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

Sergei Gorelkin wrote 24 lines
From: Sergei Gorelkin Subject: Re: [fpc-devel] SetPropValue case sensitive To: "FPC developers' list" Date: Tuesday, May 5, 2009, 2:44 PM Leonardo M. Ramé wrote: > I found a difference between Delphi's SetPropValue function with its counterpart in FPC. In Delphi, this function is case insensitive, while in fpc it is case sensitive. > > Am I correct? > The property name comparison (ending up in GetPropInfo(TypeInfo: PTypeInfo; const PropName: string), rtl/objpas/typinfo.pp line 571) is done case-insensitive, unless there is a bug somewhere. Can you provide code snippet illustrating the difference? Sergei _______________________________________________ fpc-devel maillist  -  http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email

Bogusław Brandys
to Leonardo M. Ramé
Leonardo M. Ramé wrote 9 lines
I studied a little deeper and the problem is (according to FPC 2.2.2 manual) that SetPropValue doesn't work because Variants are not implemented yet. The solution was easy, I used SetStrProp instead of SetPropValue. In my program all published properties were strings. Can you confirm if it is implemented in newer versions? Leonardo M. Ramé http://leonardorame.blogspot.com

Hmm..I thought that variants were supported long time ago but my memory is bad.
Are you sure about that ?

Boguslaw

Reply by email

Leonardo M. Ramé

Download this PDF and search for SetPropValue:

http://www.eg.bucknell.edu/~cs208/subpages/software/share/doc/fpc-2.2.2/fpc-2.2.2/rtl.pdf

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

Bogusław Brandys wrote 29 lines
From: Bogusław Brandys Subject: Re: [fpc-devel] SetPropValue case sensitive To: "FPC developers' list" Date: Tuesday, May 5, 2009, 3:06 PM Leonardo M. Ramé wrote: > I studied a little deeper and the problem is (according to FPC 2.2.2 manual) that SetPropValue doesn't work because Variants are not implemented yet. > The solution was easy, I used SetStrProp instead of SetPropValue. In my program all published properties were strings. > > Can you confirm if it is implemented in newer versions? > > Leonardo M. Ramé > http://leonardorame.blogspot.com > Hmm..I thought that variants were supported long time ago but my memory is bad. Are you sure about that ? Boguslaw _______________________________________________ fpc-devel maillist  -  http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email

Felipe Monteiro de Carvalho
to Leonardo M. Ramé
Leonardo M. Ramé wrote
Download this PDF and search for SetPropValue:

I think it's more probable that the documentation wasn't updated then that Variants aren't supported.

Felipe Monteiro de Carvalho

Reply by email