| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 667 人关注过本帖
标题:代码简化
取消只看楼主 加入收藏
yuk_yu
Rank: 3Rank: 3
等 级:论坛游侠
帖 子:334
专家分:134
注 册:2009-3-16
结帖率:85.71%
收藏
已结贴  问题点数:20 回复次数:3 
代码简化
程序代码:
这段代码可以简化,使速度加快吗?

xxx = rs.GetRows(-1, 1, Array("MRP_Cntrlr", "Req_Date", "Assy_Number", "Partcode", "Vendor_Name"))
        Set d0 = CreateObject("Scripting.Dictionary")
        Set d1 = CreateObject("Scripting.Dictionary")
        Set d2 = CreateObject("Scripting.Dictionary")
        Set d3 = CreateObject("Scripting.Dictionary")
        Set d4 = CreateObject("Scripting.Dictionary")
        For yy = 0 To UBound(xxx, 2)
            d0(xxx(0, yy)) = ""
            d1(xxx(1, yy)) = ""
            d2(xxx(2, yy)) = ""
            d3(xxx(3, yy)) = ""
            d4(xxx(4, yy)) = ""
        Next yy
        kk0 = d0.Keys
        kk1 = d1.Keys
        kk2 = d2.Keys
        kk3 = d3.Keys
        kk4 = d4.Keys

        For i = 0 To 4
            Combo1(i).Clear
            Combo1(i).AddItem "-All-"
        Next i

        For k0 = 0 To UBound(kk0)
            Combo1(0).AddItem kk0(k0)
        Next

        For k1 = 0 To UBound(kk1)
            Combo1(1).AddItem kk1(k1)
        Next

        For k2 = 0 To UBound(kk2)
            Combo1(2).AddItem kk2(k2)
        Next

        For k3 = 0 To UBound(kk3)
            Combo1(3).AddItem kk3(k3)
        Next

        For k4 = 0 To UBound(kk4)
            Combo1(4).AddItem IIf(IsNull(kk4(k4)), "", kk4(k4))
        Next


搜索更多相关主题的帖子: 代码 
2010-03-25 14:20
yuk_yu
Rank: 3Rank: 3
等 级:论坛游侠
帖 子:334
专家分:134
注 册:2009-3-16
收藏
得分:0 
回复 2楼 风吹过b
Combo1(1).AddItem 能用其他方法吗?是否只能用循环?
2010-03-26 08:41
yuk_yu
Rank: 3Rank: 3
等 级:论坛游侠
帖 子:334
专家分:134
注 册:2009-3-16
收藏
得分:0 
回复 5楼 风吹过b
版主,可以指点下吗?我还不会用TYPE,谢谢
2010-03-29 11:07
yuk_yu
Rank: 3Rank: 3
等 级:论坛游侠
帖 子:334
专家分:134
注 册:2009-3-16
收藏
得分:0 
回复 7楼 风吹过b
学习ing....感激ing...
2010-03-29 14:48
快速回复:代码简化
数据加载中...
 
   



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

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