Cant get Concat to work, please help.

  • Thread starter Thread starter Martin Fletcher
  • Start date Start date
M

Martin Fletcher

I cant get the Concat function to work, please help.
Here's some of my code.

Module modTCP
Public TCP_RECEIVED_DATA As String
Private WithEvents TCP_SERVER As New WinSockSVR

Private Sub TCP_SERVER_DataArrival(ByVal strData As String) Handles
TCP_SERVER.DataArrival
Dim strNEW_STRING As String
strNEW_STRING = String.Concat(TCP_RECEIVED_DATA, strData)
TCP_RECEIVED_DATA = strNEW_STRING
Call PROCESS_MESSAGE()
End Sub
End Module

It doesnt seem to concat the two strings
the 1st time thru TCP_RECEIVED_DATA gets updated, but the next time the sub
is fired off it doesn't update tcp_received_data.
I do it this way because I know the whole message my not be in the same
packet, so I build up the received data then use PROCESS_MESSAGE to see if
the message is complete.
 
* "Martin Fletcher said:
I cant get the Concat function to work, please help.
Here's some of my code.

Module modTCP
Public TCP_RECEIVED_DATA As String
Private WithEvents TCP_SERVER As New WinSockSVR

Private Sub TCP_SERVER_DataArrival(ByVal strData As String) Handles
TCP_SERVER.DataArrival
Dim strNEW_STRING As String
strNEW_STRING = String.Concat(TCP_RECEIVED_DATA, strData)
TCP_RECEIVED_DATA = strNEW_STRING
Call PROCESS_MESSAGE()
End Sub
End Module

It doesnt seem to concat the two strings
the 1st time thru TCP_RECEIVED_DATA gets updated, but the next time the sub
is fired off it doesn't update tcp_received_data.
I do it this way because I know the whole message my not be in the same
packet, so I build up the received data then use PROCESS_MESSAGE to see if
the message is complete.

That's 'WinSockSVR'?
 
Nevermind, the problem isnt with the code below, it is in the sub that
creates the strData. So strData is being passed bad data, which in turn
prevents the concat from working.
 
* "Martin Fletcher said:
Yes, but I dont beleive that has anything to do with the concat problem.

Maybe the string contains a 'ControlChars.NullChar' and it isn't
displayed completely.
 
Back
Top