Here's mine, result=1033.

Passes the test, but not useable for determining class A / B ip numbers...

code:
; begin MOAN
;
;!
Function MOAN($i,$n,$s)
Dim $d,$e,$f,$x,$y,$,$t,$m

$d=Split('0 0 0 0')
$e=Split(' ')
$f=Split('0 128 192 224 240 248 252 254')

$i=Split($i,'.')
$n=Split($n,'.')

If $s
If InStr($s,'.')
$s=Split($s,'.')
Else
$s=Val($s)
$x=$s/8
$y=$s mod 8
$s=$d
For $=0 to $x-1
$s[$]=255
Next
If $y
$s[$x]=$f[$y]
EndIf
EndIf
If $s[3]>252
$s=$e
EndIf
Else
$s=$e
EndIf

$m=''

$t=$d
$x=0

If $i[0] AND $s[0]
For $=0 to 3
$t[$]=Val(LTrim($i[$])) & Val(LTrim($s[$]))
Next
If $n[0]
;InRange
If Join($t)=Join($n)
$m=1
Else
$m=0
EndIf
Else
;NetID
$m=Join($t,'.')
EndIf

Else

If $i[0] AND $n[0]
;Subnets

For $=0 to 3
If Val(LTrim($i[$]))=Val(LTrim($n[$]))
$t[$]=255
$x=1+$x
Else
$=3
EndIf
Next

If $x < 4
For $=0 to 7
If (Val(LTrim($i[$x])) & Val($f[$])) = Val(LTrim($n[$x]))
$t[$x]=$f[$]
$m=$m+Join($t,'.')+','
EndIf
Next
$m=SubStr($m,1,Len($m)-1)
EndIf
EndIf

If $n[0] AND $s[0]
;IPs
For $=0 to 3
If Val(LTrim($s[$]))=255
$t[$]=Val(LTrim($n[$]))
$x=1+$x
EndIf
Next

$y=''
For $=0 to 255
If (Val(LTrim($s[$x])) & $) = Val(LTrim($n[$x]))
$y=$y+$+' '
EndIf
Next
$y=Split(SubStr($y,1,Len($y)-1))

If $x=3
For $=1+$y[0] to Val($y[Ubound($y)])-1
$t[3]=$
$m=$m+Join($t,'.')+','
Next
$m=SubStr($m,1,Len($m)-1)
EndIf

EndIf
EndIf

$moan=$m

EndFunction

;!
;!

; end MOAN

_________________________
Greetz,
Patrick Rutten

- We'll either find a way or make one...
- Knowledge is power; knowing how to find it is more powerful...
- Problems don't exist; they are challenges...