delphi7 报错list index out of bounds(0),该怎么解决

delphi7 报错list index out of bounds(0)
我在建的edit1.。。edit13 里面输入数值  
通过读取tedit(Components[m]).text中m为53-65,获得edit1—edit13中的值,
srain[n]数组是0到12.和yline,xline数组对应,如果存在空或0,就不写入excel
  n:=0;
  i:=1;
  for m:=53 to 65 do
  begin
  srain[n]:=tedit(Components[m]).text; <------发现是这条语句出的问题  
  if (srain[n] = '') or (srain[n]='0') then
  begin
  n:=n+1;
  end
  else
  begin
  ExcelApp.Cells[i,1].Value := yline[n];
  ExcelApp.Cells[i,2].Value := xline[n];
  ExcelApp.Cells[i,3].Value := srain[n];
  i:=i+1;
  n:=n+1;
  end;
  end;


------解决方案--------------------
为什么这么肯定edit是从53-65
别这么做,从0开始吧,然后判断一下

for m:=0 to ComponentCount-1 do
if (Components[m] is TEdit) then
srain[n]:=TEdit(Components[m]).Text;
------解决方案--------------------
使用1#的方法,先测试遍历一遍就知道了,报数组越界 --0

你的srain是怎么定义的啊

是不是定义为 
var 
srain : array[1..13] of String ;

应该定义为 
srain : array[0.12 of String ;才对哦

------解决方案--------------------
TStringList赋值要用slt.Add('abcde');
取值要用slt.Strings[1];你代码改成
ExcelApp.Cells[i,1].Value := yline.Strings[n];
ExcelApp.Cells[i,2].Value := xline.Strings[n];
ExcelApp.Cells[i,3].Value := srain.Strings[n];
赋值时用
for m:=0 to ComponentCount-1 do
if (Components[m] is TEdit) then
srain.add((Components[m]).Text);