home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / injoycl1.zip / injoycl1.cmd next >
OS/2 REXX Batch file  |  1996-12-10  |  2KB  |  47 lines

  1. /*                                                                           */
  2. /* utility to calculate time used online with in-joy internet dialer       */
  3. /* Written for personal use and free distribution by idiot@mindless.com */
  4. /* If you find this useful please email me and let me know              */
  5. /*                                                        */
  6. /* Installation.  Place this file in your injoy directory                    */
  7. /* and run it from the command line. simple huh :)                       */
  8. /*                                                                           */
  9. /* feel free to hack the rexx if you can make it better.  send me a copy*/
  10. /*                                                                           */
  11.  
  12. call RxFuncAdd 'SysLoadFuncs','rexxutil','sysloadfuncs'
  13. call sysloadfuncs
  14.  
  15. say ""
  16. say "In-joy online time calculator"
  17. say ""
  18.  
  19. rc = SysFileTree('*.log', 'found', 'O')
  20. do counter=rc to found.0
  21.     say counter found.counter
  22. end
  23.  
  24. say choose the log to analyse
  25. parse pull number
  26.  
  27. say "what month ? jan=01 feb=02...dec=12"
  28. parse pull input_month
  29.  
  30. total_time_online = 0
  31.  
  32. call SysFileSearch 'date', found.number, 'stem.'
  33. do i=1 to stem.0
  34.     PARSE VAR stem.i 'DATE' day.i'.'month.i'.'year.i',' shit.i ',' 'DURATION' minutes.i 'min,' seconds.i 'sec'
  35. /*    say i "day =" day.i "month ="month.i "year ="year.i "time online = "minutes.i */
  36.     if month.i = input_month
  37.         then total_time_online = total_time_online + minutes.i
  38. end
  39. say "total time online for month" input_month "=" total_time_online "minutes for this ISP"
  40. say ""
  41. say "total time online for month" input_month "=" total_time_online/60 "hours for this ISP"
  42. say ""
  43. say "Written by idiot@mindless.com and distributed as freeware. "
  44. say "Email me and tell me what you think."
  45.  
  46.  
  47.