[fpc-devel] RTTI's GetPropValue returns corrupt Boolean value
Graeme Geldenhuys
graemeg.lists at gmail.com
Tue Nov 20 16:08:14 CET 2007
On 20/11/2007, Graeme Geldenhuys <graemeg.lists at gmail.com> wrote:
>
> I've extended the PropertyMatch() function to test for tkBool types
> (no variants) and do a writeln when it finds it. That parts seems to
> work fine.
Here is the debug code I added to PropertyMatch() which successfully
compare the results, but I have to explicitly cast GetOrdProp to a
Boolean. Is that normal???
PropInfo := GetPropInfo(AObject.ClassType, PropName);
if tiGetTypeInfo(PropInfo)^.Kind = tkBool then
begin
writeln('Found rtti bool type');
lbool := Boolean(GetOrdProp(AObject, PropName));
if lSearch = lbool then
writeln('Comparison was a success');
end;
Regards,
- Graeme -
_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/
More information about the fpc-devel
mailing list