delphi 使用TThreadList的remove方法时......

sdudubing 2012-10-10 05:22:18
delphi 使用TThreadList的remove方法时提示此错误:list index out of bounds (63);
提示意思是索引越界问题,TThreadList是delphi提供的类,remove是其方法,使用它怎么会出现此问题?
望高手指点啊
...全文
296 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
sdudubing 2012-10-10
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 的回复:]

你先看看TThreadList里是否有63这个索引的数据呢?
[/Quote]

if ((client.Name=client1.Name) and (not (client.Socket=client1.Socket))) then
begin
if sockettemp=-1 then
begin
sockettemp:=TSimpleClient(Items[i]).Socket; //clc-11-24
end;
Remove(client1);
end;

能够执行到Remove,应该是有此索引的数据吧.....
sdudubing 2012-10-10
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 的回复:]

你先看看TThreadList里是否有63这个索引的数据呢?
[/Quote]
if ((client.Name=client1.Name) and (not (client.Socket=client1.Socket))) then
begin
if sockettemp=-1 then
begin
sockettemp:=TSimpleClient(Items[i]).Socket; //clc-11-24
end;
Remove(client1);
end;

能够执行到Remove,应该是有此索引的数据吧.....
Mit1208 2012-10-10
  • 打赏
  • 举报
回复
你先看看TThreadList里是否有63这个索引的数据呢?
sdudubing 2012-10-10
  • 打赏
  • 举报
回复
自己先顶了啊

5,392

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧