Quote:
What do you mean the split statement doesn't work. What version of kix are you using? When i run this on my machine, i get the right output.
Code:
$printers="Printer1,Printer2,Printer3"
$Printer1 = "user1, user2, Eric"
$Printer2 = "user1, user2, user4"
$Printer3 = "user1, Eric, user8, user2"
for each $printer in split($printers, ",")
$curPrinter = "$" + $printer
$ = execute('$$curPrinter = $curPrinter')
? $curPrinter
if instr($curPrinter, @userid)
? "user gets this printer"
endif
next
Output:
Quote:
user1, user2, Eric
user gets this printer
user1, user2, user4
user1, Eric, user8, user2
user gets this printer
Thanks a lot!
I don't know what was wrong on my PC, but this code didn't work (it was erroring out on split command). However, the troubles I had with my variables solved now. Thanks!
PS.
btw, you don't need split if you define printers variable like this :
$printers=Printer1,Printer2,Printer3
and then:
for each $printer in $printers
:-)