Zoney...

Borrowing from your example, how about something like this ...

code:

$subnet = substr("@ipaddress0", 1, 11) ; Get workstation subnet address

select

case $subnet = "142.122. 22"
$printer = "\\hostname\printer22"

case $subnet = "142.122. 23"
$printer = "\\hostname\printer23"

case $subnet = "142.122. 24"
$printer = "\\hostname\printer24"

case 1
$printer = ""

endselect

if $printer
use lpt1: "$printer"
endif


Shawn.