Results 1 to 3 of 3

Thread: A HARD one (i think?)

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2000
    Posts
    113
    Hear's What i'm trying to do

    Winsock1.sentdata "players = 5"
    Winsock1.GetData New_Text
    strLeft = Left$(New_Text, InStr(New_Text, " = ") - 1)
    strRight = Right$(New_Text, Len(New_Text) - InStr(New_Text, " = ") - 2)
    strLeft = strRight
    I don't want strLeft = strRight i want the players = 5
    if that is not posibel then, can I use the memory addres of a variable to change it's value?

    As you may see i'm trying to use the string in strLeft as a variable and strRight to set the value of the string in strLeft. In other words CAN I USE A variable in a variable?

    This board is probbly getting BOARD of me and this Question. I'm sorry


    [Edited by BIacksun on 09-04-2000 at 01:06 AM]

  2. #2
    Lively Member Kersey's Avatar
    Join Date
    Jun 1999
    Location
    The Netherlands
    Posts
    101

    NO you can not!

    you might use a select case for all variables you want to send over and check which variable is send.

  3. #3
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    As I understand it strLeft contains the name of a varíable that you want to assign the value of strRight.
    Well if you have VB6 you could use CallByName to do this.
    The variable (players in this case) must either be a Property procedure or a public variable declared in a Form or a Class module.
    This code example assumes that the players variable is declared as a Public variable in the same form that executes the code:
    Code:
    Winsock1.GetData New_Text
    strLeft = Trim$(Left$(New_Text, InStr(New_Text," = ") - 1))
    strRight = Trim$(Mid$(New_Text, InStr(New_Text, "= ") + 1))
    CallByName Me, strLeft, vbLet, Val(strRight)
    Good luck!

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