| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 341 人关注过本帖
标题:[求助]我又来了,自己都烦了。。。[已解决]
只看楼主 加入收藏
tanghuawei
Rank: 4
来 自:美丽的湖南
等 级:业余侠客
威 望:3
帖 子:531
专家分:220
注 册:2006-3-16
结帖率:100%
收藏
 问题点数:0 回复次数:2 
[求助]我又来了,自己都烦了。。。[已解决]

假如我代码是这样的:
If page = 1 then
Message(1) = "&H" & combo1(0).ListIndex
Message(2) = "&H" & combo2(0).ListIndex
Message(3) = "&H" & combo3(0).ListIndex
Message(4) = "&H" & combo4(0).ListIndex
Message(5) = "&H" & combo5(0).ListIndex
Message(6) = "&H" & combo6(0).ListIndex
ElseIf page = 2 then
Message(1) = "&H" & combo1(0).ListIndex
Message(2) = "&H" & combo2(0).ListIndex
Message(3) = "&H" & combo3(0).ListIndex
Message(4) = "&H" & combo4(0).ListIndex
Message(5) = "&H" & combo5(0).ListIndex
Message(6) = "&H" & combo6(0).ListIndex

Message(7) = "&H" & combo1(1).ListIndex
Message(8) = "&H" & combo2(1).ListIndex
Message(9) = "&H" & combo3(1).ListIndex
Message(10) = "&H" & combo4(1).ListIndex
Message(11) = "&H" & combo5(1).ListIndex
Message(12) = "&H" & combo6(1).ListIndex
ElseIf page = 3 then
Message(1) = "&H" & combo1(0).ListIndex
Message(2) = "&H" & combo2(0).ListIndex
Message(3) = "&H" & combo3(0).ListIndex
Message(4) = "&H" & combo4(0).ListIndex
Message(5) = "&H" & combo5(0).ListIndex
Message(6) = "&H" & combo6(0).ListIndex

Message(7) = "&H" & combo1(1).ListIndex
Message(8) = "&H" & combo2(1).ListIndex
Message(9) = "&H" & combo3(1).ListIndex
Message(10) = "&H" & combo4(1).ListIndex
Message(11) = "&H" & combo5(1).ListIndex
Message(12) = "&H" & combo6(1).ListIndex

Message(13) = "&H" & combo1(2).ListIndex
Message(14) = "&H" & combo2(2).ListIndex
Message(15) = "&H" & combo3(2).ListIndex
Message(16) = "&H" & combo4(2).ListIndex
Message(17) = "&H" & combo5(2).ListIndex
Message(18) = "&H" & combo6(2).ListIndex
ElseIf page = 4 then
...
ElseIf page = 150 then

End If
请教高手,如果这样写肯定是个愚蠢的方法,要如何写一个循环表示上面的意思?谢谢!

[此贴子已经被作者于2007-4-14 11:32:09编辑过]

2007-04-14 10:51
huangwy
Rank: 1
等 级:新手上路
威 望:2
帖 子:297
专家分:0
注 册:2007-3-23
收藏
得分:0 
Dim i%, j%, k%
Dim msg$
For i = 1 To 5
For j = 1 To i
For k = (j - 1) * 6 + 1 To (j - 1) * 6 + 6 Step 6
Message(1 + k - 1) = "&H" & combo1(j - 1).ListIndex
Message(2 + k - 1) = "&H" & combo2(j - 1).ListIndex
Message(3 + k - 1) = "&H" & combo3(j - 1).ListIndex
Message(4 + k - 1) = "&H" & combo4(j - 1).ListIndex
Message(5 + k - 1) = "&H" & combo5(j - 1).ListIndex
Message(6 + k - 1) = "&H" & combo6(j - 1).ListIndex


Next k



Next j
Next i
2007-04-14 11:29
tanghuawei
Rank: 4
来 自:美丽的湖南
等 级:业余侠客
威 望:3
帖 子:531
专家分:220
注 册:2006-3-16
收藏
得分:0 
呵呵,谢谢了, 已经解决了

汽车尾气检测网络系统QQ:357766186__MSN:MSNTHW19850316@
2007-04-14 11:31
快速回复:[求助]我又来了,自己都烦了。。。[已解决]
数据加载中...
 
   



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

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