Hello Oleg,
what would be the easiest way to check if a task is running?
Do I have to loop through all tasks like that...
cnt = RoboTaskApp.TaskCount
For i = 0 To cnt - 1
extNam = RoboTaskApp.TaskInfoExtName(i)
Next
...until I find the external task name searching for, get the TaskNum (variable i) and then use TaskInfoState?
Thank you.
Check, if task is running
Re: Check, if task is running
See the example of VB script
See all methods and properties of RoboTaskApp object here: http://www.robotask.com/help/index.php? ... object.htm
Code: Select all
num = RoboTaskApp.TaskNumByExternalName("MyTestTask")
if num >= 0 then
st = RoboTaskApp.TaskInfoState(num)
LogMessage(cstr(st))
else
LogMessage("No such task!!!")
end if
Oleg Yershov
Re: Check, if task is running
The same example on JavaScript
Code: Select all
num = RoboTaskApp().TaskNumByExternalName("MyTestTask");
if (num >= 0)
{
st = RoboTaskApp().TaskInfoState(num);
LogMessage(st);
}
else
{
LogMessage("No such task!!!");
}
Oleg Yershov