 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Nikola Jankoviæ Guest
|
Posted: Sat Jan 21, 2006 6:22 pm Post subject: RTTI, GetProp not working as I wish it would |
|
|
I sincerely hoped that something like:
procedure TBaseObjList.FilterByDate(propName: string; startDate, endDate:
TDateTime);
var
i: Integer;
prop: TDateTime;
begin
for i:= Count-1 downto 0 do
begin
prop:= TDateTime(GetObjectProp(TBaseObj(Items[i]),propName));
if (prop < startDate) or (prop > endDate) then
Remove(TBaseObj(Items[i]));
end;
end;
procedure TBaseObjList.FilterByProperty(propName: string; propValue: string);
var
i: Integer;
begin
for i:= Count-1 downto 0 do
begin
if GetStrProp(TBaseObj(Items[i]),propName) <> propValue then
Remove(TBaseObj(Items[i]));
end;
end;
would work, but it doesn't. I get EPropertyError that property does not exist,
although it does and it is published (in second example), and incompatible types
(in first).
Please help me make it work.
Thanks in advance
nikola
|
|
| Back to top |
|
 |
Rob Kennedy Guest
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|