|
-
Sep 3rd, 2000, 11:59 PM
#1
Thread Starter
Lively Member
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]
-
Sep 4th, 2000, 02:57 AM
#2
Lively Member
NO you can not!
you might use a select case for all variables you want to send over and check which variable is send.
-
Sep 4th, 2000, 04:41 AM
#3
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|