|
-
Nov 28th, 1999, 06:53 AM
#1
Thread Starter
Member
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
-
Nov 28th, 1999, 07:11 AM
#2
Hyperactive Member
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).]
-
Nov 28th, 1999, 07:32 AM
#3
Thread Starter
Member
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
-
Nov 28th, 1999, 07:45 AM
#4
Hyperactive Member
Just change
ipParts = Split("192.168.1.1", ".", -1, vbTextCompare)
to
ipParts = Split(Text1.Text, ".", -1, vbTextCompare)
or whatever the textbox's name is.
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
|