数组中的字符串(100分)

  • 主题发起人 主题发起人 smiledayly
  • 开始时间 开始时间
S

smiledayly

Unregistered / Unconfirmed
GUEST, unregistred user!
type
Tawake=record
No: integer;
Content: string;
SubWay: string;
Way: integer;
StartTime: Tdatetime;
LastTime: tdatetime;
NextTime: Tdatetime;
Times: integer;
Flag: integer;
end;

使用它:
for i := 0 to NextNo -1 do
begin
awake.No := tmpawake.No;
awake.content := tmpawake.content; //可通过
awake.way := tmpawake.way;
awake.SubWay := tmpawake.subway; //报错,???地址错???奇怪
awake.starttime := tmpawake.starttime;
awake.lasttime := tmpawake.LastTime;
awake.NextTime := tmpawake.NextTime;
awake.Times := tmpawake.Times;
awake.flag := tmpawake.flag;
end;

报错,???地址错???奇怪
 
awake.way := tmpawake.way;
awake.SubWay := tmpawake.subway;
这两行顺序反了,应该是:
awake.SubWay := tmpawake.subway;
awake.way := tmpawake.way;
 
顺序反了会引起什么错误?
 
应该按照TYPE里声明的顺序,DELPHI帮助里面有
 
awake.flag := tmpawake.flag;//不明白你这么写是什么意思,是两个数组吗?
type
Tawake=record
No: integer;
Content: string;
SubWay: string;
Way: integer;
StartTime: Tdatetime;
LastTime: tdatetime;
NextTime: Tdatetime;
Times: integer;
Flag: integer;
end;
var
awake:array[0..NextNo] of Tawake;//先声明这个数组
i:integer;
begin
for i:=0 to NextNo do
begin
awake.No:=1;
~~~~~~~~~~~~~~~
~~~~~~~~~~~
~~~~~~~~~~~
end;
end;
 
多人接受答案了。
 
分已给给你们了,你们还是帮我看看。
将awake.ini copyto c:/windows 下会出问题。
另,给点编程的建议。(如果是说没有注释就不用提醒了)
谢谢!
 
后退
顶部