我想添加记录进入CheckListBox。程序如下,错误,请帮忙
for i:=0 to length(str) do
begin
bol:=true;
for j:=1 to re_mnsz_form.CheckListBox1.Count do
if copy(str,i*18+1,11) =re_mnsz_form.CheckListBox1.Items.Strings[j] then
begin
bol:=false;
break;
end
else
continue; if bol=true then
begin
re_mnsz_form.CheckListBox1.Items.Add(copy(str,i*18+1,11));
end;错误是 CheckListBox1.Items.intex 益处,请指导
for i:=0 to length(str) do
begin
bol:=true;
for j:=1 to re_mnsz_form.CheckListBox1.Count do
if copy(str,i*18+1,11) =re_mnsz_form.CheckListBox1.Items.Strings[j] then
begin
bol:=false;
break;
end
else
continue; if bol=true then
begin
re_mnsz_form.CheckListBox1.Items.Add(copy(str,i*18+1,11));
end;错误是 CheckListBox1.Items.intex 益处,请指导
改为for j:=0 to re_mnsz_form.CheckListBox1.Count-1 do
re_mnsz_form.CheckListBox1.Items.Add(copy(str,i*18+1,11));
每次增加,如何才能是ITEM里的横增多,否则出错,谢谢