How do we get the IP Address to appear properly when we see the following:
quote:
__1.__2.__3.__4
??
We really want to see -
quote:
1.2.3.4
{Edit 30-April-2003}
Note: This requires KiX version 4.10 or better.
code:
$ipadr=join(split(@IPADDRESS0,' '),'')
Thanks Jens!!
OK, so I want to segregate the second octet from 1.2.3.4. That is, I want to find the users that are in the "2" subnet.
Expanding the above code, we can do that..
code:
$2oct=split(join(split(@IPADDRESS0,' '),''),'.')[1]
{/Edit}
{Edit 22-April-2003}
If you have KiX 4.x, you can do the following:
code:
$1st=LTRIM(split(@ipaddress0,'.')[0])
$2nd=LTRIM(split(@ipaddress0,'.')[1])
$3rd=LTRIM(split(@ipaddress0,'.')[2])
$4th=LTRIM(split(@ipaddress0,'.')[3])
$ipadr='$1ST.$2ND.$3RD.$4TH' ; #ip#
{/Edit}
With Pre-4.x versions, you can do the following:
code:
;*************************************************************************************
; Get the User's IP Address and trim appropriately
;*************************************************************************************
;LTRIM - TRIM THE LEADING SPACES FROM A STRING
;SUBSTR - RETURNS PART OF STRING: START POSITION, LENGTH
$1st=LTRIM(SUBSTR(@ipaddress0,1,3));#ip#
$2nd=LTRIM(SUBSTR(@ipaddress0,5,3));#ip# Get the IP# and assign it to $ipadr
$3rd=LTRIM(SUBSTR(@ipaddress0,9,3));#ip#
$4th=LTRIM(SUBSTR(@ipaddress0,13,3));#ip#
$ipadr='$1ST.$2ND.$3RD.$4TH';#ip#
[ 01. May 2003, 16:22: Message edited by: kdyer ]