Re: task function request

new topic     » goto parent     » topic index » view thread      » older message » newer message

Ryanj posted code...
i tested it...
it didn't run right... but it's also late at night, and he did help even if the code didn't run. I came up with this:

  
sequence taskvars_ids = {}  
sequence taskvars_datas = {}  
 
export function task_get_var(atom taskid)  
    object taskvar  
    atom idx  
  
    idx = find(taskid, taskvars_ids)  
      
    if idx > 0 then  
        return taskvars_datas[idx]  
    else  
        return 0  
    end if     
end function  
  
export procedure task_set_var(atom taskid, object taskdata)  
    atom idx  
 
    idx = find(taskid, taskvars_ids)  
    if idx = 0 then 
      taskvars_ids &= taskid 
      taskvars_datas &= {taskdata} 
    end if 
    if idx > 0 then  
        taskvars_datas[idx] = taskdata 
    end if  
end procedure  
  

I added it to my task.e. It's running using news4.ex and a new unreleased version of http.e. News4.ex looks really nice with a percent of download ticker running for each site. News5.ex no longer crashes from http.e being terminated by the OS, and it also has a download percent ticker.

Thank you lots, Ry!

useless

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu