home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 213a.lha / LogRexx / logon.rexx < prev    next >
OS/2 REXX Batch file  |  1996-02-14  |  754b  |  36 lines

  1. /* ARexx time logging program: called by 'logon <your name>' */
  2. parse arg YourName
  3. if YourName = ''
  4. then 
  5.   do
  6.     say "Please enter your name: "
  7.     parse pull YourName
  8.   end
  9.      
  10. logFILE='log:log'||YourName
  11. etFILE='T:et'||YourName
  12. cuFILE='T:CurrentUser'
  13.  
  14. if ~open('mylog',logFILE,'A') 
  15. then 
  16.   do
  17.     if ~open('mylog',logFILE,'W')
  18.     then 
  19.       do
  20.         say "failed to open log file"
  21.         exit
  22.       end
  23.   end
  24.   
  25. if open('etime',etFILE,'W') 
  26. then 
  27.   do
  28.     if open('cu',cuFILE,'W')
  29.     then dummy=writeln('cu',YourName)
  30.     else exit
  31.     dummy=writeln('etime',time('e'))
  32.     outline = YourName || " logging on at: " || time() || ' ' || date('N')
  33.     say outline
  34.     dummy=writeln('mylog',outline)
  35.   end         
  36. else say "failed to open "etFILE