我定义类型:
type
TLOCOINFO = class rtime : tdatetime;
locono : string;
trainno : string;
sj : string;
jlh : string;
cz : string;
coord : string;
time : string;
xh : string;
sd : integer;
xs : integer;
gy : integer;
cs : integer;
gk : string;
end;定义对象:
var
t : TLOCOINFO;在赋值时: t.sj := 'abc'; ...
报错:EAccessViolation 异常。请问怎么回事?
type
TLOCOINFO = class rtime : tdatetime;
locono : string;
trainno : string;
sj : string;
jlh : string;
cz : string;
coord : string;
time : string;
xh : string;
sd : integer;
xs : integer;
gy : integer;
cs : integer;
gk : string;
end;定义对象:
var
t : TLOCOINFO;在赋值时: t.sj := 'abc'; ...
报错:EAccessViolation 异常。请问怎么回事?
sj:string[20];试一下。
把class改成record
ok
2:t := TLOCOINFO.Create
3: 天知道在赋值时: t.sj := 'abc'; ... 你按了t.的时候ctrl+space有没有出现sj ????