Now that you have had some fun trouble shooting...
This is how I would format it:
Dim $iparray[2]
$ipaddress=@IPADDRESS0
$iparray[0]='192.168.2.0/24'
$iparray[1]='192.168.3.0/24'
$iparray[2]='192.168.4.0/24'
call "isiniprange.udf"
Select
case isiniprange($ipaddress,$iparray[0])
$S=AddPrinterConnection ("\\diction\Woodstock Front Desk02")
$S=AddPrinterConnection ("\\woodstock02\Woodstock Label Printer")
$S=AddPrinterConnection ("\\diction\OHIP")
$S=SetDefaultPrinter ("\\diction\Woodstock Front Desk02")
case isiniprange($ipaddress,$iparray[1])
$S=AddPrinterConnection ("\\diction\Stratford Front Desk02")
$S=AddPrinterConnection ("\\stratford01\Stratford Label Printer")
$S=AddPrinterConnection ("\\diction\OHIP")
$S=SetDefaultPrinter ("\\diction\Stratford Front Desk02")
case isiniprange($ipaddress,$iparray[2])
$S=AddPrinterConnection ("\\goderichfrndsk\Goderich Front Desk01")
$S=AddPrinterConnection ("\\goderichfrndsk\Goderich Label Printer")
$S=AddPrinterConnection ("\\diction\OHIP")
$S=SetDefaultPrinter ("\\goderichfrndsk\Goderich Front Desk01")
EndSelect
{edit} used PostPrep so that one could copy/paste directly to your text editor.
Also check the dependencies of IsInIPrange().
[ 17. March 2003, 05:49: Message edited by: Howard Bullock ]