For j = dataSep.GetLowerBound(0) To dataSep.GetUpperBound(0)
rxdmix.Text &= dataSep(j)
rxdcounter.Text &= dataSep(2 * j)
rxdvolt.Text &= dataSep((2 * j) + 1)
Next
想請問各位高手要如何成功分離奇數項與偶數項字串,希望有高手可以幫忙解惑
謝謝!
以下是VB2010的程式碼
'**************************************************************
'計時器控制項的Timer事件
'將接收的動作放於其中,只要有資料就會被接收進來
'**************************************************************
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim instring As String,dataStr As String,Sep(0) As Char
Dim dataSep() As String, i As Integer, j As Integer
instring = ""
Try
RS232.ReadTimeout = 1000
instring = RS232.ReadExisting()
If instring.Length = 0 Then
Exit Sub