home *** CD-ROM | disk | FTP | other *** search
/ Amiga Elysian Archive / AmigaElysianArchive.iso / prog / arexx / welc2205.lha / Examples / Poller.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1993-04-12  |  1.2 KB  |  63 lines

  1. /*
  2.  
  3.     Name        : Poller.rexx
  4.     Created        : 12-Apr-93
  5.     Programmer    : Urban Lindeskog
  6.     Organisation    : ProNova SoftWare Development Group
  7.     Purpose        : Poll the Boss and show a nice report
  8.               if there's any new files.
  9.     Requires    : Welcome > 2.165 and LOGFILE in FTick.cfg
  10.               is set to 'MAIL:Logs/TodayTick.log'.
  11.  
  12. Config:
  13. */
  14. PictureFile = "B:BigDisk"
  15. WelRun = 0
  16.  
  17. OPTIONS RESULTS
  18. OPTIONS FAILAT 15
  19.  
  20. ADDRESS Command
  21.  
  22. 'TrapDoor Call Boss'
  23. 'FTick >NIL:'
  24.  
  25. if open(Log, 'MAIL:Logs/TodayTick.log', 'r') then do
  26.  
  27.     'Type MAIL:Logs/TodayTick.log >> MAIL:Logs/Tick.log'
  28.  
  29.     do while ~eof(Log)
  30.         instring = readln(Log)
  31.         if 0 < find(instring, 'Received') then do
  32.             filename=substr(instring,30)
  33.             Tog=2
  34.  
  35.             if(WelRun==0) then do
  36.                 'Run Welcome LEFT 'PictureFile' TEXT "You have received some files!" COLUMNS 80 ROWS 10'
  37.                 'Wait 1'
  38.                 address WELCOME
  39.                 WelRun = 1
  40.             end
  41.         end
  42.         if Tog==1 then do
  43.             TEXT 'Received 'filename' In area 'substr(instring,29)
  44.             Tog=0
  45.         end
  46.         if(Tog==2) then Tog=1
  47.  
  48.     end
  49.  
  50.     if WelRun==1 then do
  51.         TEXT ''
  52.         TEXT 'Press Control-C to continue...'
  53.         QUIT WAIT
  54.     end
  55.  
  56.     address Command
  57.     if close(Log) == 0 then do
  58.         say Could not close the log-file
  59.     end
  60.  
  61.     'Delete >NIL: MAIL:Logs/TodayTick.log'
  62. end
  63.