索引超出数组界限
Dim SendData(3) As Byte
Dim ReceiveData(255) As Byte
Dim i As Integer
If AxMSComm1.PortOpen = True Then
'On Error GoTo ErrorHandler
SendData(0) = &H84
SendData(1) = &H1E
SendData(2) = &HCC
SendData(3) = &H91
AxMSComm1.Output = SendData
AxMSComm1.InBufferCount = 0 '清空接收缓冲区
AxMSComm1.InputLen = 2
'AxMSComm1.RThreshold = 1
ReceiveData = AxMSComm1.Input
If ReceiveData(0) = &HF1 Then -----这里为什么报索引超出数组界限的错误