问题是这样的,我要将ListView1(report风格)中的各条记录取出来写进一个配置文件,
for ItemsCount:=0 to ListView1.Items.Count-1 do
begin
Caption:=ListView1.Items[ItemsCount].Caption;
for SubItemsCount:=0 to ListView1.Columns.Count-2 do
begin
aIniFile.WriteString(Caption,'',ListView1.Items[ItemsCount].SubItems[SubItemsCount]);
end;
end;
但是执行到aIniFile.WriteString就报错:
Project Project1.exe raised exception class EStringListError with message 'List index out of bounds(0)'这是什么错误?请高手指点一下吧
for ItemsCount:=0 to ListView1.Items.Count-1 do
begin
Caption:=ListView1.Items[ItemsCount].Caption;
for SubItemsCount:=0 to ListView1.Columns.Count-2 do
begin
aIniFile.WriteString(Caption,'',ListView1.Items[ItemsCount].SubItems[SubItemsCount]);
end;
end;
但是执行到aIniFile.WriteString就报错:
Project Project1.exe raised exception class EStringListError with message 'List index out of bounds(0)'这是什么错误?请高手指点一下吧
解决方案 »
- CoolTrayIcon控件在win98中ShowBalloonHint为啥不能显示?
- 怎么用ADO,通过SQL语句生成Paradox表的主键?
- 请问如何在DBGrid中把‘小数‘显示为百分比形式?
- 请问,判断一个字符串是否为数字的函数是什么?
- 编译成功的exe程序在有些机器上无法运行,谁能帮我解决一下
- 请教下,证卷行情数据是以什么形式保存的?
- 如何使一模式对话框当按下一属性为mrOK或mrCancel的按钮时不关闭此对话框?
- 求助问题,只知道菜单控件TMuneItem的Caption 怎样写禁掉该TMuneItem方法
- 一个菜鸟问题,请高手解答~
- Delphi的那个Delphi Direct...总让我很不放心,它会不会是木马程序呢?
- 哪位大哥能帮我写一个产生随机数的程序啊???急求!
- 如何能在WIN2000 个人版能装上SQL SERVER2000服务端?
begin
Caption:=ListView1.Items[ItemsCount].Caption;
for SubItemsCount:=0 to ListView1.Items[ItemsCount].SubItems.Count-1 do
begin
aIniFile.WriteString(Caption,'',ListView1.Items[ItemsCount].SubItems[SubItemsCount]);
end;
end;