home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / cpm / bbs / dbbs50.lbr / MESSAGEX.CZD / MESSAGEX.CMD
OS/2 REXX Batch file  |  1988-03-31  |  2KB  |  98 lines

  1. * MESSAGE.CMD
  2. * For terminals WITHOUT full-screen editing!
  3.  
  4. USE USERS
  5.  
  6. * No full-screen editing
  7. STORE F TO CHANGE,FS
  8.  
  9. IF .NOT. FS
  10.  ?
  11.  ACCEPT 'Enter delete date (MM/YY) MONTH/YEAR' TO DDATE
  12. *STORE '00/00' TO DDATE
  13.  
  14. *?
  15. *? 'You may send this message to more than one user.'
  16. *? 'Please enter the number of users you wish to receive'
  17. *? 'this message (maximum of 5).'
  18. *?
  19. *STORE T TO WRONG
  20. *DO WHILE WRONG
  21. *   INPUT 'Number to send to' TO SNUM
  22. *   IF SNUM=0
  23. *      STORE 1 TO SNUM
  24. *   ENDIF
  25. *   IF SNUM<6
  26. *      STORE F TO WRONG
  27. *   ENDIF
  28. *ENDDO
  29. STORE 1 TO SNUM
  30.  
  31. STORE 1 TO CNT
  32. * get all the names to send TO
  33. DO WHILE CNT<SNUM+1
  34.    STORE STR(CNT,1) TO CL
  35.    ACCEPT 'To (RETURN for all)' TO R&CL
  36.    IF R&CL=' ' .AND. SNUM>1
  37.       ? 'You may not send a bulk message to ALL!'
  38.       LOOP
  39.    ENDIF
  40.    STORE !(R&CL) TO R&CL
  41.    IF R&CL=' ' .AND. SNUM=1
  42.       STORE 'ALL' TO R&CL
  43.    ENDIF
  44.    IF R&CL#'ALL'
  45.       LOCATE ALL FOR NAME=R&CL
  46.       IF EOF
  47.          ? 'Not a currently known user. Try again...'
  48.          LOOP
  49.       ENDIF
  50.    ENDIF
  51.    STORE CNT+1 TO CNT
  52. ENDDO
  53.  
  54. ACCEPT "Subject" TO RE
  55. IF RE=' '
  56.    RELE RE,CNT,R1,SNUM,CHANGE,CL,DDATE
  57.  
  58.    RETURN
  59. ENDIF
  60.  
  61. IF SNUM=1
  62.    STORE T TO WRONG
  63.    DO WHILE WRONG
  64.    ACCEPT "Password (or '*' if private)" TO PPASS
  65.    IF PPASS='*' .AND. R&CL='ALL'
  66.       ? "Can't leave private mail to ALL!"
  67.    ELSE
  68.       STORE F TO WRONG
  69.    ENDIF
  70.    ENDDO
  71. ELSE
  72.    STORE '*' TO PPASS
  73. ENDIF
  74.  
  75. * get the next message #
  76. USE HEADER+'
  77. GO BOTT
  78. STORE NO+1 TO MSG:NMBR
  79.  
  80. ?
  81. USE MSG-TEMP
  82. GO TOP
  83. * If there are any records!!
  84. IF ##0
  85.    ? 'Cleaning up first...'
  86.    ?
  87.    DELE ALL
  88.    PACK
  89. ENDIF
  90.  
  91. STORE 1 TO NUM
  92. * GO BOTT
  93. * STORE #+1 TO FIRST
  94.  
  95. DO A:ADD-MSG
  96. DO A:EDIT-MSG
  97.  
  98.