scripting@wanadoo.nl




divIP()

http://www.scriptlogic.com/kixtart/FunctionLibrary_FunctionList.aspx


actual FunctionLibrary list on 'Scriptlogic' site printer-friendly mirror of UDF topic on 'scripting@wanadoo.nl' site close
5 August 2002 divIP()
AuthorOlaf Gradin
Action Strip IP address to separate octets for use in mathematical comparisons, et al. Concatenates trimmed IP address together as human-readable form (e.g. 192.168.0.10).
SyntaxdivIP () 
Parameters 
RemarksOne could substitute the @IPADDRESS0 with parameters to get multiple IP addresses. 
Returns$myIP (Array, 4 values)
$strIP (concatenated IP string (e.g. 192.168.0.10)) 
DependenciesNone. 
Examples
Printing:
 ? "IP Address   : " + $strIP

Using in Logic:

 SELECT
 CASE $myIP[0] = 192
   IF $myIP[1] = 168
     SELECT
     CASE $myIP[2] = 1 OR $myIP[2] = 2
       "expression"
     CASE $myIP[2] >= 10 AND $myIP[2] <= 13
       "expression"
     ENDSELECT
   ENDIF
 ENDSELECT

 
Source
FUNCTION divIP ()
  $aip = Split(@ipaddress0,".")
  $myIP = 0,0,0,0
  $strIP = ""

  $n = 0
  FOR EACH $element IN $aip
    $myIP[$n]=Val(Trim($element))
    $n=$n+1
  NEXT

  $n = 0
  FOR EACH $element IN $myIP
    $strIP = $strIP + $element
    IF $n < 3
      $strIP=$strIP+"."
      $n=$n+1
    ENDIF
  NEXT
ENDFUNCTION ; - divIP -
 
  original source of UDF topic. show actual FunctionLibrary list on Scriptlogic site close top
          printer-friendly mirror of UDF topic on scripting@wanadoo.nl site  




Copyright © 2003 www.scriptlogic.com & scripting@wanadoo.nl - last updated on 20 May 2003


Site Meter