請問各位大大:
我用RS-232的功能想傳送很多個TextBox的資料到另一台電腦,
傳送是沒問題但是接收端卻把傳送過來的資料全放在同一格,即是沒法對應接收
傳送:
Case "Command12" '傳送資料
If MsgBox("接受方請務必在新增狀態", vbYesNo + vbExclamation, "傳送資料") = vbYes Then
For e = 0 To 29
If e <> 1 Then
MSComm1.Output = Trim(Text1(e))
End If
Next e
End If
接收:
Private Sub MSComm1_OnComm()
Select Case MSComm1.CommEvent
Case comEvReceive
If MSComm1.InBufferCount > 0 Then
For e = 0 To 29
If e <> 1 Then
Text1(e) = Text1(e) + MSComm1.Input
End If
Next e
End If
End Select
End Sub
請問該如何解決?? 謝謝!!!
我用RS-232的功能想傳送很多個TextBox的資料到另一台電腦,
傳送是沒問題但是接收端卻把傳送過來的資料全放在同一格,即是沒法對應接收
傳送:
Case "Command12" '傳送資料
If MsgBox("接受方請務必在新增狀態", vbYesNo + vbExclamation, "傳送資料") = vbYes Then
For e = 0 To 29
If e <> 1 Then
MSComm1.Output = Trim(Text1(e))
End If
Next e
End If
接收:
Private Sub MSComm1_OnComm()
Select Case MSComm1.CommEvent
Case comEvReceive
If MSComm1.InBufferCount > 0 Then
For e = 0 To 29
If e <> 1 Then
Text1(e) = Text1(e) + MSComm1.Input
End If
Next e
End If
End Select
End Sub
請問該如何解決?? 謝謝!!!
文章標籤
全站熱搜

傳送: Case "Command12" '傳送資料 If MsgBox("接受方請務必在新增狀態", vbYesNo + vbExclamation, "傳送資料") = vbYes Then For e = 0 To 29 If e <> 1 Then MSComm1.Output = Trim(Text1(e)) End If if e<>29 then MSComm1.Output ="," Next e End If 接收: Private Sub MSComm1_OnComm() Select Case MSComm1.CommEvent Case comEvReceive If MSComm1.InBufferCount > 0 Then Text1 = split(MSComm1.Input,",") End If End Select End Sub
謝謝大大的指導!! 趕快來試試~~~
大大還是不行ㄝ?? Case "Command12" '傳送資料 If MsgBox("接受方請務必在新增狀態", vbYesNo + vbExclamation, "傳送資料") = vbYes Then For e = 0 To 29 If e <> 1 Then MSComm1.Output = Trim(Text1(e)) End If if e<>29 then MSComm1.Output ="," End If Next e End If 接收: Private Sub MSComm1_OnComm() Select Case MSComm1.CommEvent Case comEvReceive If MSComm1.InBufferCount > 0 Then Text1 = split(MSComm1.Input,",") End If End Select End Sub 是這樣嗎?我試過還是沒反應ㄝ!!