I'm trying to use this code to change passwords for a user if a task is scheduled on the system by that user. For testing purposes, I'm trying to change the user as well. I'm getting the error : TRIGGER : Array name undefined! for each task in the arrray. I'm pretty sure all arrays have been named. Any help would be appreciated.

 Code:
Call @SCRIPTDIR + '\tcLib.kxf'
$Tasks = tcGetTasks($target)
For Each $Task in $Tasks
  tcInit(1) 
  tcGetEvent($target, $Task)
  If InStr($a_tcTASK[20], $olduser)
    tcSetEventCredentials($target, $Task, $newuser, $password)
  EndIf
Next
_________________________
I could have made a neat retort but didn't, for I was flurried and didn't think of it till I was downstairs.
-Mark Twain