Hi

Run your script in debug mode and you will see!

In debug mode you step thru the script line by line, normally any error messages will appear in the debug screen and you can see what your code is doing line by line.

If your code is not doing as you expect it to, then debug is the way to find out why.

Try this in a test.kix and run it in debug mode.

;************
$wksta=@wksta
$a=substr($wksta,5,2) ;take last two char
$what_rm=val($a) ;change to number

if $what_rm > 30
AT 4,4 "This is connecting to U18"
addprinterconnection(\\upperserver\EpsonU18)
addprinterconnection(\\upperserver\KyoU18)
else
At 4,4 "This is connecting to U26"
addprinterconnection(\\upperserver\KyoU26)
addprinterconnection(\\upperserver\EpsonU26)
endif
;******************

Hope this helps.
Rgds
Don