Hey guys.. can someone explain me how to use the GetPropList stuff ? I don't quite grab…
dvortex wrote 21 lines
You've to do something like:
var
pi : ptypeinfo;
pp : pproplist;
pt : ptypedata;
pri : ppropinfo;
begin
pi:=o.classinfo; { o is the class you want to inspect }
pt:=gettypedata(pi);
getmem(pp,pt^.propcount*sizeof(pointer));
getpropinfos(pi,pp);
// Now you can play with pp:
for i:=0 to pt^.propcount-1 do
begin
pri:=pp^[i];
case pri^.proptype^.kind of
tkfloat:
writeln('Value of: ',pri^.name,GetFloatValue(o,pri));
...I'll send our test program for rtti to your private email (everybody can get it doing
cvs checkout tests
(it's the file tests\test\testrtti.pp)
I think it's a very good example about using rtti.
If you've still questions, feel free to ask, I coded most of FPCs rtti stuff.
