Graeme Geldenhuys wrote:
On 20/11/2007, Graeme Geldenhuys <[EMAIL PROTECTED]> 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;

Sounds familiar. Here I have:

  if UsePublishedGetter then
    Result := Boolean(GetOrdProp(Owner, Metadata.Name))
  else
    Result := Value;

--
Joao Morais
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to