The flaw in your logic is that you're trying to compare a string to a value. Your IP octets are strings unless you convert them with Val().

The way to do it is as follows:
code:
$1st = Val(SUBSTR(@ipaddress0, 1, 3))
$2nd = Val(SUBSTR(@ipaddress0,5,3))
$3rd = Val(SUBSTR(@ipaddress0,9,3))
$4th = Val(SUBSTR(@ipaddress0,13,3))

_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.