being new to OpenOffice I am not sure how to convert the function to be used in OpenOffice.
Code: Select all
Function IP2Dec(ip As String) As String
Dim str1, str2, str3, str4 As String
Dim dec1, dec2, dec3, dec4 As Integer
str1 = Left(ip, Find(".", ip, 1) - 1)
str2 = Mid(ip, Len(str1) + 2, ( Find(".", ip, Len(str1) + 2) - Len(str1) -2))
str3 = Mid(ip, Len(str1) + Len(str2) + 3, ( Find(".", ip, Len(str1) + Len(str3) + 3) - (Len(str1) + Len(str2) + 3))
str4 = Right(ip, Len(ip) - (Len(str1) + Len(str2) + Len(str3) + 3))
dec1 = (str1)*2^24
dec2 = (str2)*2^16
dec3 = (str3)*2^8
dec4 = (str4)*2^0
IP2Dec = (dec1 + dec2 + dec3 + dec4)
End Function
How do I use calc functions inside my function ?
In VB the Find function would be Application.WorksheetFunction.Find(x, y, z) is there some sort of equivalent in calc ?