Results 1 to 3 of 3

Thread: [RESOLVED] VB Server - Java Client

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2005
    Posts
    192

    Resolved [RESOLVED] VB Server - Java Client

    I am writing a program that will be using sockets in both java & vb to transmit information. I have already figured out how to connect and send the data, not a prob there. However my issue lies in parsing the data, Java when sending the data seems to be putting out a terminator of some sort prefixed before every character it sends out, it is like this symbol: □ what do I need to do to parse it out? Because it is chopping off the data that is read in my list view.

    Example of how the data is sent:
    □H□e□l□l□o□ □W□o□r□l□d□!

  2. #2
    PowerPoster gavio's Avatar
    Join Date
    Feb 2006
    Location
    GMT+1
    Posts
    4,462

    Re: VB Server - Java Client

    Every "correct" character is at even index in your String... so use Mod() in a loop:
    VB Code:
    1. Dim oldString As String
    2.     oldString = "□H□e□l□l□o□ □W□o□r□l□d□!" 'this is where you retrieve your String for example
    3.    
    4. Dim N As Long
    5. Dim newString As String
    6.     For N = 1 To Len(oldString)
    7.         If N Mod 2 = 0 Then
    8.             newString = newString & Mid(oldString, N, 1)
    9.         End If
    10.     Next N
    11.         Debug.Print newString 'returns "Hello World!"

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jun 2005
    Posts
    192

    Re: VB Server - Java Client

    Thanks, looks promising, added a point to your reputation.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width