Yes, im trying to seperate a string which just so happens to be a Ip. I want to be able to set some of the ip into a variable. Like lets say the ip is 123.32.21.12 How would u take out the 123.32.21. part and store it in a variable. Please Help
Printable View
Yes, im trying to seperate a string which just so happens to be a Ip. I want to be able to set some of the ip into a variable. Like lets say the ip is 123.32.21.12 How would u take out the 123.32.21. part and store it in a variable. Please Help
Try something like this: (IF you have VB6)
------------------Code:Private Sub Command1_Click()
Dim ipParts() As String
ipParts = Split("192.168.1.1", ".", -1, vbTextCompare)
MsgBox "The First Part is: " & ipParts(0) & "." & ipParts(1) & "." & ipParts(2) & "."
End Sub
Tom Young, 14 Year Old
[email protected]
ICQ: 15743470 Add Me ICQ Me
AIM: TomY10
PERL, JavaScript and VB Programmer
[This message has been edited by Compwiz (edited 11-28-1999).]
That worx with the ip directly but is there a way to retrieve the ip from the textbx and then have it use it because when i trie to do that it doesnt wnat to work
Just change
ipParts = Split("192.168.1.1", ".", -1, vbTextCompare)
to
ipParts = Split(Text1.Text, ".", -1, vbTextCompare)
or whatever the textbox's name is.