出现这两个错误应该如何解决?(10分)

  • 主题发起人 yydreamer
  • 开始时间
Y

yydreamer

Unregistered / Unconfirmed
GUEST, unregistred user!
出现这两个错误应该如何解决?

第一个:list index out of bounds(0)

第二个:Access violation at address 004CFF9A in module'Project1.exe'.Read of address 00000090
 
数组越界,指针越界
 
第二条也是这个意思吗?
 
第一个:list index out of bounds(0)
数组越界:如你的存储过程6个参数,你却在程序中为[0]--[6]共7个参数赋值....
第二个:Access violation at address 004CFF9A in module'Project1.exe'.Read of address 00000090
一般情况是你新加入的Form被在项目建立时自动被建立,二在程序中你有Create.
解决方法:菜单 Project/Options 将(左栏中)自动建立的该form移动到动态建立栏(右栏)
 
第二个问题明白了 :)
但是,第一个问题:
我定义的数组没有越界呀
var
my_time:array[0..3] of TDateTime;
my_hour:array[0..1] of integer;
begin
my_time[0]:=StrToTime(my_inifile.ReadString('workplan','Time_AmStart','8:30:00'));
my_time[1]:=StrToTime(my_inifile.ReadString('workplan','Time_AmEnd','12:00:00'));
my_time[2]:=StrToTime(my_inifile.ReadString('workplan','Time_PmStart','13:00:00'));
my_time[3]:=StrToTime(my_inifile.ReadString('workplan','Time_PmEnd','17:30:00'));

my_hour[0]:=round((my_time[1]-my_time[0])*24);
my_hour[1]:=round((my_time[3]-my_time[2])*24);
 
to zhongtu
你已经回答了http://www.delphibbs.com/delphibbs/dispq.asp?lid=1087932
你能解释一下为什么要加chr(39)吗?
解释完,我就要给你分了
 
chr(39)是什么意思??能解释一下吗
 
多人接受答案了。
 
顶部