Table of Content
HAL Forum
boolean function RemoveTask (
string TaskName)
Description:
Kills/Removes the task that was created with NewTimedTask/NewPeriodicTask. Returns true on success.
Parameters:
TaskName The name of the task that was specified when the task was defined with NewTimedTask/NewPeriodicTask
procedure StartSysRun_DueReport(Integer action,Time at)
begin
  Time t;
  Date td;

  t = at;
  td = CurrentDate;
  if (blanktime(t)) then begin
    t.hour = 1;
    t.minute = 0;
    t.second = 0;
  end;

  switch (action) begin
    case 0:
      if (t<CurrentTime) then begin
        td.day = td.day + 1;
      end;
      NewTimedTask("SYSRUN_DUEREPORT","Sys Run Due Report","SysRuns","DueReport",td,t,"");
    case 1:      
      td.day = td.day + 1;
      NewTimedTask("SYSRUN_DUEREPORT","Sys Run Due Report","SysRuns","DueReport",td,t,"");
    case 2:         
      RemoveTask("SYSRUN_DUEREPORT");
      if (t<CurrentTime) then begin
        td.day = td.day + 1;
      end;
      NewTimedTask("SYSRUN_DUEREPORT","Sys Run Due Report","SysRuns","DueReport",td,t,"");
  end;
  return;
end;
Related topics:
««