用VB做毕设,编译是出现Case没有SelectCase的错误,请大大们帮帮忙吧~

来源:百度知道 编辑:UC知道 时间:2024/05/07 08:51:01
具体代码如下:
Public Sub InputManager()
intCommFlag = 16

Dim bytTest() As Byte

Dim strReceive As String

Dim intTest As Long

Dim strTemp As String

frmMain.ctrMSComm.InputMode = comInputModeBinary
frmMain.ctrMSComm.InputLen = 6

bytTest = frm.ctrMSComm.Input
ReDim Preserve bytTest(5) '获取帧头

If bytTest(0) = 1 And bytTest(1) = 0 Then
intReceiveLen = bytTest(2) * 100 + bytTest(3)
frmMain.ctrMSComm.InputMode = commInput.ModeText
frmMain.ctrMSComm.InputLen = 0
For n = 1 To 1000000
Next n
strReceive = frmMain.ctrMSComm.Input
strTemp = "接收:" + strReceive
Call frmMain.ReceiveDisplay(strTemp, 2)

ElseIf bytTest(0) = 0 And bytTest(1) = 1 Then
intTest = bytTest(2) * 100 + bytTest(3)

Select Case intTest
Case 101
intReceiveLen = bytTest(4)
frmMain.ctrMSComm.InputMode

Case 1

If bytTest(4) = 1 Then
intDataNumber = intDataNumber + 1
If intDataNumber > intDataCount Then
Call FileSendManager(4)
Else
Call FileSendManager(1)

End If
intCommFlag = 1

这段少一个End If

多半 是 嵌套 出问题了

你把程序 按 缩进 方式 整理一下

或许 就发现 问题了

祝你顺利

If bytTest(4) = 1 Then 没有对应的 end if