【发布时间】:2009-10-04 07:27:13
【问题描述】:
我正在学习 Delphi Prism,但我不知道如何用它编写以下代码:
type
TRapportItem = record
Label : String;
Value : Int16;
AnomalieComment : String;
end;
type
TRapportCategorie = record
Label : String;
CategoriesItems : Array of TRapportItem;
end;
type
TRapportContent = record
Categories : array of TRapportCategorie;
end;
然后,在某个地方,我尝试将项目放入数组中:
rapport.Categories[i].Label:=l.Item(i).InnerText;
但它不起作用..有人可以启发我吗?
谢谢!
【问题讨论】:
-
你能展示你声明和初始化变量'rapport'的代码吗?
-
我只添加了 'rapport : TRapportContent;'到接口的受保护部分。我错过了什么?我还尝试将 CategoriesItems 声明为 TRapportItem 的 Array [0..64];但我有同样的问题。感谢您这么快回复!
-
我发现了我昨天做的另一个测试:使用 'regular' delphi 我可以编写 setlength(rapport.Categories,10);将我的数组声明为动态数组时,但我找不到如何使用 prism 编写相同的数组。
标签: arrays delphi record delphi-prism oxygene