如何将以下VB6程序转换成VB2005程序?
以下为VB下的程序:DimABAsString'串口数据分析用OnErrorResumeNextIfMSComm1.PortOpen=FalseThenMSComm1.P...
以下为VB下的程序:
Dim AB As String '串口数据分析用
On Error Resume Next
If MSComm1.PortOpen = False Then MSComm1.PortOpen = True
'清除端口信息
MSComm1.InBufferCount = 0
MSComm1.OutBufferCount = 0
'接收数据串
MSComm1.Output = Chr$(27) + "p"
Do
DoEvents
If flag1 = 1 Then GoTo 10
Loop Until MSComm1.InBufferCount >= 13
If MSComm1.InBufferCount >= 13 Then
AB = MSComm1.Input
Txt_SM = Trim(Mid(AB, 1, 9))
Label5 = Trim(Mid(AB, 10, 3))
End If
10: If MSComm1.PortOpen = True Then MSComm1.PortOpen = False
目前我通过VB2005,已经Dim Rs232 As SerialPort
请问以下程序要如何写才正确:请批点 展开
Dim AB As String '串口数据分析用
On Error Resume Next
If MSComm1.PortOpen = False Then MSComm1.PortOpen = True
'清除端口信息
MSComm1.InBufferCount = 0
MSComm1.OutBufferCount = 0
'接收数据串
MSComm1.Output = Chr$(27) + "p"
Do
DoEvents
If flag1 = 1 Then GoTo 10
Loop Until MSComm1.InBufferCount >= 13
If MSComm1.InBufferCount >= 13 Then
AB = MSComm1.Input
Txt_SM = Trim(Mid(AB, 1, 9))
Label5 = Trim(Mid(AB, 10, 3))
End If
10: If MSComm1.PortOpen = True Then MSComm1.PortOpen = False
目前我通过VB2005,已经Dim Rs232 As SerialPort
请问以下程序要如何写才正确:请批点 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询