hvordan får jeg nu dette til at virke?:
ShowMessage(sub.items[number].items[numberi].description);
i den nye Subsubitem skal der være disse strings:
description
title
url
jeg har denne kode i forvejen:
type
tsubitem = class(TCollectionItem)
public
url,title: string;
end;
tsubscripts = class(TCollection)
function getitem(index: integer): tsubitem;
constructor create;
public
function add: tsubitem; overload;
procedure add(title, url: string); overload;
property items[index: integer]: tsubitem read getitem;
end;
//////////////////////
function tsubscripts.getitem(index: integer): tsubitem;
begin
result := inherited getitem(index) as tsubitem;
end;
function tsubscripts.add: tsubitem;
begin
result := inherited add as tsubitem;
end;
procedure tsubscripts.add(title, url: string);
var a: tsubitem;
begin
a := add;
a.title := title;
a.url := url;
end;
constructor tsubscripts.create;
begin
inherited create(tsubitem);
end;
Indlæg senest redigeret d. 02.09.2006 19:08 af Bruger #8254