| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 593 人关注过本帖
标题:循环语句``能不能帮我解释下呢``
取消只看楼主 加入收藏
早睡早起
Rank: 1
等 级:新手上路
帖 子:26
专家分:0
注 册:2008-3-13
收藏
 问题点数:0 回复次数:2 
循环语句``能不能帮我解释下呢``
option explicit
private sub command1_click()
dim i as integer
if list1.selcount=1 then
   list1.removeitem list1.listindex
elseif list1.listcount > 1 then
  for i = list1.listcount - 1 to 0 step -1
    if list1.selected(i) then
       list1.removeitem i
   end if
  next i
end if
end sub


其实我主要是下面这个地方十分不理解``
for i = list1.listcount - 1 to 0 step -1
    if list1.selected(i) then
       list1.removeitem i
   end if
  next i
搜索更多相关主题的帖子: 语句 解释 
2008-05-07 21:21
早睡早起
Rank: 1
等 级:新手上路
帖 子:26
专家分:0
注 册:2008-3-13
收藏
得分:0 
option explicit
private sub command1_click()
dim i as integer
if list1.selcount=1 then
   list1.removeitem list1.listindex
elseif list1.listcount > 1 then
  for i = list1.listcount - 1 to 0 step -1   '移除选中的项目???
    if list1.selected(i) then
       list1.removeitem i
   end if
  next i
end if
end sub



list1.listcount 这个代表的意思是所有的项目是么```

其实我也就是想知道原理`
他是怎么删除选中的项目呢``
list1.listcount - 1 to 1 step -1
步长是-1``list1.listcount -1 是怎么回事``
2008-05-07 22:13
早睡早起
Rank: 1
等 级:新手上路
帖 子:26
专家分:0
注 册:2008-3-13
收藏
得分:0 
谢谢各位的指教``感谢```
2008-05-08 11:42
快速回复:循环语句``能不能帮我解释下呢``
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016051 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved