- Home
·
- Internet/HTML
·
- This simple function will return a Long number when provided with an Internet address. This is very
This simple function will return a Long number when provided with an Internet address. This is very
This simple function will return a Long number when provided with an Internet address. This is very useful if you use or plan to use the
Rate This simple function will return a Long number when provided with an Internet address. This is very
(1(1 Vote))
Dim sFirst As String
Dim sSecond As String
Dim sThird As String
Dim sForth As String
Dim sAddress() As String
'create an array by splitting the address by "."
sAddress = Split(Trim(sIP), ".")
'Get the hex of the number
sFirst = Hex$(CLng(sAddress(0)))
'make a 8-bit number by placing any 0's in front of the returned hex
sFirst = String$(2 - Len(sFirst), "0") & sFirst
'repeat
sSecond = Hex$(CLng(sAddress(1)))
sSecond = String$(2 - Len(sSecond), "0") & sSecond
sThird = Hex$(CLng(sAddress(2)))
sThird = String$(2 - Len(sThird), "0") & sThird
sForth = Hex$(CLng(sAddress(3)))
sForth = String$(2 - Len(sForth), "0") & sForth
MakeLongOfInternetAddress = CLng("&H" & sFirst & sSecond & sThird & sForth)
End Function
This simple function will return a Long number when provided with an Internet address. This is very Comments
No comments yet — be the first to post one!
Post a Comment