home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / murexx05.zip / SUBCLIST.CMD < prev   
OS/2 REXX Batch file  |  1994-11-16  |  2KB  |  76 lines

  1. /* MaxUserREXX Examples                                                    */
  2. /* Subscriber List                                                         */
  3. '@echo off'
  4.  
  5. Parse Upper Arg NodeNumber
  6.  
  7. if NodeNumber = '' Then
  8.     Exit 1
  9.  
  10. /* Setup the catch all loader for the user functions                       */
  11. Call RxFuncAdd 'UserLoadFuncs', 'MaxUser', 'UserLoadFuncs'
  12.  
  13. /* Load all the user functions at once                                     */
  14. Call UserLoadFuncs
  15.  
  16. /* Define some constants                                                   */
  17. UserError = 'ERROR'
  18. UserFile = 'D:\MAX\USER.BBS'
  19. LastUserFile = 'D:\MAX\LASTUS'NodeNumber'.BBS'
  20. UserPad = '       '
  21.  
  22. /* Open the user file for use */
  23. UserCount = OpenUserFile(LastUserFile)
  24. index = 0
  25. Color = QueryUserVideoMode(index)
  26. Call CloseUserFile
  27.  
  28. /* Open the user file for use */
  29. UserCount = OpenUserFile(UserFile)
  30.  
  31. if UserCount <> UserError then do
  32.     Signal On Syntax Name BadCommand
  33.     Signal On Halt Name BadCommand
  34.     ii = 0
  35.     index = 0
  36.     if Color = 'ANSI' Then
  37.         Call CharOut , x2c('1b')'[2J'x2c('0d')||x2c('0a')||x2c('1b')'[1;33m'
  38.     Say Copies(' ', 16)'Current Subscribers to the Workplace Connection'
  39.     Call CharOut , x2c('0d')||x2c('0a')
  40.     Say Copies(' ', 19)'Helping to Keep the Workplace Going Strong'
  41.     if Color = 'ANSI' Then
  42.         Call CharOut , x2c('1b')'[1;37m'
  43.     Call CharOut , x2c('0d')||x2c('0a')||x2c('0d')||x2c('0a')||UserPad
  44.     do until index = UserCount
  45.         UserLevel = QueryUserPriviledge(index)
  46.         UserExpInfo = QueryUserExpiryInfo(index)
  47.         if UserLevel='EXTRA' Then Do
  48.             Call CharOut , Left(QueryUserAlias(index), 20)'  '
  49.             ii = ii + 1
  50.             if ii // 3 = 0 Then
  51.                 Call CharOut , x2c('0d')||x2c('0a')||UserPad
  52.         end
  53.         index = index + 1
  54.     end
  55.     Call CharOut , x2c('0d')||x2c('0a')
  56.     Call CharOut , x2c('0d')||x2c('0a')
  57.     if Color = 'ANSI' Then
  58.         Call CharOut , x2c('1b')'[0m'
  59.  
  60.     /* Close up shop and free the system resources */
  61.     Call CloseUserFile
  62.     Call CharOut , 'Press ENTER to continue. . .'
  63.     Pull .
  64. end
  65.  
  66. /* We are done, so we can drop all the functions                           */
  67. Call UserDropFuncs
  68. Exit 0
  69.  
  70. BadCommand:
  71.     Say
  72.     Say 'REXX Error ('rc')'
  73.     Call CloseUserFile
  74.     Call UserDropFuncs
  75.     Exit 2
  76.