LongAddress




Type MyLong
Value As Long
End Type

Type MyIP
A As Byte
B As Byte
C As Byte
D As Byte
End Type

Function IPToString(Value As Double) As String
Dim l As MyLong
Dim i As MyIP
l.Value = DoubleToLong(Value)
LSet i = l
IPToString = i.A & "." & i.B & "." & i.C & "." & i.D
End Function

Function DoubleToLong(Value As Double) As Long
If Value <= 2147483647 Then
DoubleToLong = Value
Else
DoubleToLong = -(4294967296# - Value)
End If
End Function

Esempio :
Result = IPToString(2220112843#)











( longaddress.html )- by Paolo Puglisi - Modifica del 17/12/2023