Suo Cong wrote:
> 
> Thanks a lot, Kev.
> 
> I found them.
> 
answers in line:

> How can I get the ID of a task by its name? So far I only use query 
> TaskList to retrieve a list of tasks to find the required one.

you need to use this syntax:
        set TaskID = ##Class(%SYSTEM.Task).FindId(Name)

I use this syntax to make sure only one instance is inserted into the 
Task list, then if its not there, insert the entry and then as a double 
check, find the ID again 

example
        set TaskID = ##Class(%SYSTEM.Task).FindId(Name)
        if TaskID write !,"'",Name,"' is Already installed as Job Number 
",TaskID quit  ; its already setup      ;      now insert the task,
        set TaskID = ##Class(%SYSTEM.Task).FindId(Name)
        if TaskID write !,"'",Name,"' is now installed as Job Number ",TaskID 
quit  ; its already setup       Write !,"something went wrong with setting 
up '"_Name,"'"_rc_"-"_TaskID 


> 
> Another question, if I delete a task will it run again after 
> restarting the Cache?

As far as I know, once its deleted, then that's it, its gone !
you have to have an entry in the task list in order that it can be re-
started ! 
> 
> By the way, can i delete the system task 'Free Space'? If a system 
> task can be deleted, how can I recover them?
I only know that if you re-install Cache (over the top of the existing 
installations) then it re-installs the tasks 


kev


Reply via email to