delphi tpersonrec需要声明麽?

来源:百度知道 编辑:UC知道 时间:2024/06/21 07:28:35
var
PersonRec :TPersonRec;
.....
运行的时候提示:
[Error] Unit1.pas(28): Undeclared identifier: 'TPersonRec'
请问怎麽囘事?

不是类
TPersonRec是一个记录,Rec是record的缩写


Var
Form1:TForm1;
后面加上记录声明就行了

TPerson=record
//成员列表
end;

TPersonRec看样子应该是一个自定义的类,所以在使用之前,应该在单元的接口部分的Uses里面加上该类所在的单元名