4 Replies - 634 Views - Last Post: 15 June 2012 - 06:42 AM Rate Topic: -----

#1 michaelysnb  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 17-December 11

how to manipulate/process code inside a string

Posted 27 May 2012 - 03:52 AM

i am now developing a LAN quizbee game for our school. I wanted now how to manipulate or process(by the other computer connected in LAN) the code that are inside a textbox that will be sent as a string. How can I?I am now using the Winsock control. Any comment will be appreciated. Thanks



for example:
i have a form which has a textbox and command button in it.
i type in the textbox(inside):
msgbox "Hello"
then i click send. Now the other computer will receive the string="msgbox="Hello""
Then it will process it and display a messagebox with the message Hello in it.
How can i do that?

Is This A Good Question/Topic? 0
  • +

Replies To: how to manipulate/process code inside a string

#2 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 271
  • View blog
  • Posts: 1,632
  • Joined: 26-March 09

Re: how to manipulate/process code inside a string

Posted 27 May 2012 - 04:14 AM

Have a look at this tutorial on creating a simple chat program using WinSock.

If you're already using WinSock as you state, maybe you could post your code and explain what problems you currently have.
Was This Post Helpful? 0
  • +
  • -

#3 BobRodes  Icon User is offline

  • Your Friendly Local Curmudgeon
  • member icon

Reputation: 545
  • View blog
  • Posts: 2,904
  • Joined: 19-May 09

Re: how to manipulate/process code inside a string

Posted 29 May 2012 - 09:45 AM

Also, please explain more clearly what you want to "manipulate or process".

This post has been edited by BobRodes: 29 May 2012 - 09:45 AM

Was This Post Helpful? 0
  • +
  • -

#4 leixnt  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 30
  • Joined: 24-July 11

Re: how to manipulate/process code inside a string

Posted 14 June 2012 - 09:35 PM

i think you cant use that
alternate ways is use symbol code to identify that you want show message box on other client
see my example below


[client1]
insert text like "!M hello" on textbox


then

[client2]
read string
if left(getdata,2) = "!M" then
msgbox mid(getdata,3, len(getdata) - 3)
end if


hope this would help your problem
Was This Post Helpful? 0
  • +
  • -

#5 BobRodes  Icon User is offline

  • Your Friendly Local Curmudgeon
  • member icon

Reputation: 545
  • View blog
  • Posts: 2,904
  • Joined: 19-May 09

Re: how to manipulate/process code inside a string

Posted 15 June 2012 - 06:42 AM

Keep in mind also that if you have quotation marks in your string, you will have to change them. Think about this: how does VB know the difference between the quotes that enclose your string and the quotes that are to be taken literally? The code
myString = "He said "Hello." to me."
will give a syntax error.

The most concise way to show that the quotes around the word "Hello" are to be taken literally is to double them, like this:
myString = "He said ""Hello."" to me."
You will need to search for quotes in your string and use string manipulation functions to double them before sending your string out.

This post has been edited by BobRodes: 15 June 2012 - 06:43 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1