A quick suggestion -

Instead of:
code:
$subnet=SubStr(@ipaddress0,9,3)
IF ($subnet = " 10")
..

You can do:
code:
$subnet=Ltrim(SubStr(@ipaddress0,9,3))
IF ($subnet = "10")

HTH,

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's