Debug 101

When code isn't working, add lots of print statements to figure out what it's doing, and comment out the actual actions.

Code:
$ArrPtrs = Split("Printer1,Printer2,Printer3",",")
For Each $Ptr In $ArrPtrs
  'current PTR value is >' $Ptr '<' ?
  ; other code...
Next

Note the leading / trailing angle brackets - they precisely delimit the content of the variable, which will disclose any leading or trailing spaces as well as empty vars.

A lot of my code contains DBG('message >' + $Var + '<' + @CRLF) strings. the DBG function simply displays the message it receives IF the global $DEBUG variable is set:

Code:
Function Dbg($_Msg)
  If $DEBUG
    $_Msg
  EndIF
EndFunction


Glenn
_________________________
Actually I am a Rocket Scientist! \:D