| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 695 人关注过本帖
标题:运行时总是出现错误9,“下标越界”?
取消只看楼主 加入收藏
wxl900306
Rank: 1
等 级:新手上路
帖 子:26
专家分:2
注 册:2012-3-14
结帖率:85.71%
收藏
已结贴  问题点数:20 回复次数:1 
运行时总是出现错误9,“下标越界”?
程序代码:
Private Sub MSComm1_OnComm()
    Dim BytReceived() As Byte
    Dim strBuff As Variant
   
    Select Case Case 2
        MSComm1.InputLen = 0
        strBuff = MSComm1.Input
        BytReceived() = strBuff
        Dim i As Long
        For i = 0 To UBound(BytReceived)
           Debug.Print BytReceived(i)
        Next
        If i <= 2 Then
        Text2 = BytReceived(0)
        BytReceived(0) = 0
        Else
        tongyi = BytReceived(0)
        BytReceived(0) = 0
        fandui = BytReceived(2)
        BytReceived(2) = 0
        qiquan = BytReceived(4)
        BytReceived(4) = 0
        End If
    End Select
我这段代码那里有问题   为什么运行时经常出现 错误9,“下标越界”   调试时总指在qiquan = BytReceived(4)这一行
2013-05-16 09:20
wxl900306
Rank: 1
等 级:新手上路
帖 子:26
专家分:2
注 册:2012-3-14
收藏
得分:0 
回复 3楼 Artless
什么意思啊!!!
2013-05-16 20:37
快速回复:运行时总是出现错误9,“下标越界”?
数据加载中...
 
   



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

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