帮我看看下面的代码?
czp 2001-12-15 01:50:34 为什么类的实例不能访问其实例字段?:
Type
TNj = record
njh: integer;
ydns: integer;
Njlx: integer;
njmc: string;
end;
TKs = record
ksmc: string;
ksh: integer;
kch: string;
end;
TNodeInf = class
private
fNj: TNj;
fKs: Tksary;
{ Private declarations }
public
// constructor Create(xqh,xqmc: string);
procedure SetNj(njmc: string; njh,ydns,Njlx: integer);
procedure SetKs(ksmc,kch: array of string; ksh: array of integer );
end;
implementation
procedure TNodeInf.SetNj(njmc: string; njh,ydns,Njlx: integer);
begin
fNj.njmc := njmc;
fnj.njh := njh;
fnj.ydns := ydns;
fnj.Njlx := Njlx;
end;
....
为什么我在建立该对象的实例后,通过其实例调用时:
NodeInfo.SetNj('dd',9,7,5) ;
总是Access violation at address 004862af in ...错误?