home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / slip-cm.zip / Tasks.CMD < prev   
OS/2 REXX Batch file  |  1994-03-20  |  1KB  |  45 lines

  1. /***************************************************************/
  2. /*                                                             */
  3. /***************************************************************/
  4.  
  5. trace OFF
  6.  
  7.   tasks = ""
  8.   queue = "TASKS"
  9.  
  10.   call rxqueue delete, queue
  11.   call rxqueue create, queue
  12.   
  13.   previous = rxqueue(set, queue)
  14.  
  15.  "@pstat | rxqueue" queue
  16.  
  17.   do while (queued() > 0)
  18.     parse pull line
  19.  
  20.     if (skip == 1) then iterate
  21.     if (strip(left(line, 10)) == "") then iterate
  22.  
  23.     if (pos(".EXE", line) <> 0) then do
  24.       skip = (strip(translate(line)) = "SYSTEM SEMAPHORE INFORMATION") 
  25.  
  26.       if (words(line) >= 8) then do
  27.          parse var line . . . name ".EXE" . 
  28.  
  29.          start = lastpos("\", name)
  30.  
  31.          if (start == 0) then
  32.            task = name
  33.          else
  34.            task = substr(name, (start + 1))
  35.       
  36.          tasks = (tasks task)
  37.       end /* if */
  38.     end /* if */
  39.   end /* while */
  40.  
  41.   call rxqueue set, previous
  42.  
  43. return strip(tasks)
  44.  
  45.