;------------------------------------------------------------------------------------------------------------------------------------------ #DefineFunction udfIPtoDec (strIP) fltDec = 0.0 For intI = 1 To 4 fltDec = 256.0 * fltDec + ItemExtract (intI, strIP, ".") Next Return fltDec ;.......................................................................................................................................... ; Parameter strIP must be a valid ip number string of format "n.n.n.n" with n=0..255 ; ; Detlev Dalitz.20011014.20100207. ;.......................................................................................................................................... #EndFunction ;------------------------------------------------------------------------------------------------------------------------------------------ ; Test. strIP1 = "10.12.11.1" ; 168561409. strIP2 = "127.0.0.1" ; 2130706433. strIP3 = "255.255.255.255" ; 4294967295. For intI = 1 To 3 fltDec = udfIPtoDec (strIP%intI%) Message ("Demo udfIPtoDec (strIP)", "IP = " : strIP%intI% : @CRLF : "decimal = " : fltDec) Next Exit