home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / murexx05.zip / calldate.cmd next >
OS/2 REXX Batch file  |  1995-02-28  |  1KB  |  46 lines

  1. /* MaxUserREXX Examples                                                    */
  2. '@echo off'
  3.  
  4. /* Setup the catch all loader for the user functions                       */
  5. Call RxFuncAdd 'UserLoadFuncs', 'MaxUser', 'UserLoadFuncs'
  6.  
  7. /* Load all the user functions at once                                     */
  8. Call UserLoadFuncs
  9.  
  10. /* Define some constants                                                   */
  11. UserError = 'ERROR'
  12. UserFile = 'USER.BBS'
  13.  
  14. /* Open the user file for use */
  15. UserCount = OpenUserFile(UserFile)
  16.  
  17. if UserCount <> UserError then do
  18.     Signal On Syntax Name BadCommand
  19.     Signal On Halt Name BadCommand
  20.     index = 0
  21.     Say '  U#   Name                 Data'
  22.     Say ' ---- -------------------- --------------------'
  23.     do until index = UserCount
  24.         UserName = Left(QueryUserName(index), 20)
  25.         LastCall = QueryUserLastCallDate(index)
  26.         NoCalls  = Right(QueryUserSystemCalls(index), 6)
  27.         credits = Right(QueryUserCredit(index), 6)
  28.         Say Right(index, 5)' 'UserName' 'LastCall' 'noCalls' 'credits
  29.         index = index + 1
  30.     end
  31.  
  32.     /* Close up shop and free the system resources */
  33.     Call CloseUserFile
  34. end
  35.  
  36. /* We are done, so we can drop all the functions                           */
  37. Call UserDropFuncs
  38. Exit
  39.  
  40. BadCommand:
  41.     Say
  42.     Say 'REXX Error ('rc')'
  43.     Call CloseUserFile
  44.     Call UserDropFuncs
  45.     Exit
  46.