home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 7 / FreshFishVol7.bin / bbs / comm / spot-1.3.lha / Spot / Rexx / FinishUp.spot < prev    next >
Text File  |  1994-08-14  |  4KB  |  143 lines

  1. /**************************************************************/
  2. /*                      Finish Up v1.0                        */
  3. /*           Written by Jan-willem van Eys (JAVE)             */
  4. /*       Inspired by COP.Spot by Brett Lappan (Fu Lee)        */
  5. /**************************************************************/
  6. /* Why not use this script as '_Quit.Spot' (I do...)          */
  7. /**************************************************************/
  8. /*   Saves settings (unless you select 'quit')                */
  9. /* Option to:                                                 */
  10. /*   Unmark ALL unanswered messages                           */
  11. /*   Unmark ALL unread messages                               */
  12. /*   Export all mail                                          */
  13. /*   Maintenance                                              */
  14. /*   Optimize                                                 */
  15. /**************************************************************/
  16. /*                                                            */
  17. /* It probably isn't the most beatiful way of getting it done */
  18. /* in Arexx, but at least it works (and that for the second   */
  19. /* thing I ever wrote in Arexx...)                            */
  20. /* Anyway, suggestions are welcome...                         */
  21. /*                                                            */
  22. /* Fido:  2:283/2.11                                          */
  23. /*  NLA: 14:100/108.4                                         */
  24. /**************************************************************/
  25.  
  26. /* Set some defaults */
  27.  
  28. NL='0d'x
  29. exp='NO '
  30. mai='NO '
  31. opt='NO '
  32. unr='NO '
  33. unp='NO '
  34.  
  35. /* Start it all... */
  36.  
  37. ADDRESS spot
  38. OPTIONS RESULTS
  39.  
  40. /* What do they want? */
  41.  
  42. 'requestresponse TITLE "Finish Up" PROMPT "Export messages?" GADGETS "_Yes|_Quit|_No"'
  43.  
  44. IF rc = 1 THEN DO
  45.     Exporteer=1
  46.     exp=YES
  47. END
  48. IF rc = 2 THEN DO
  49.     'quitspot NOREQ'
  50.     EXIT
  51. END
  52.  
  53. 'requestresponse TITLE "Finish Up" PROMPT "Maintenance?'NL''NL'WARNING!'NL'~~~~~~~~'NL'May delete messages" CENTER GADGETS "_Yes|_No"'
  54.  
  55. IF rc = 1 THEN DO
  56.     onderhoud=1
  57.     mai=YES
  58. END
  59.  
  60. 'requestresponse TITLE "Finish Up" PROMPT "Optimize?'NL''NL'WARNING!'NL'~~~~~~~'NL'May take a while" CENTER GADGETS "_Yes|_No"'
  61.  
  62. IF rc = 1 THEN DO
  63.     optimaal=1
  64.     opt=YES
  65. END
  66.  
  67. 'requestresponse TITLE "Finish Up" PROMPT "Clear following flags?" GADGETS "Un_replied|_Unread|_Both|_None"'
  68.  
  69. IF rc = 1 THEN DO
  70.     antwoord=1
  71.     unp=YES
  72.     lezen=0
  73. END
  74.  
  75. IF rc = 2 THEN DO
  76.     antwoord=0
  77.     lezen=1
  78.     unr=YES
  79. END
  80.  
  81. IF rc = 3 THEN DO
  82.     antwoord=1
  83.     lezen=1
  84.     unp=YES
  85.     unr=YES
  86. END
  87.  
  88.  
  89. 'requestresponse TITLE "Finish Up" PROMPT "LAST CHANCE'NL'Continue?'NL''NL'     Export: 'exp''NL'Maintenance: 'mai''NL'   Optimize: 'opt''NL'     Unread: 'unr''NL'  Unreplied: 'unp'" CENTER GADGETS "_Yes|Just _Quit|_Abort"'
  90.  
  91. IF rc = 2 THEN DO
  92.     'quitspot NOREQ'
  93.     EXIT
  94. END
  95. IF rc = 0 THEN DO
  96.     EXIT
  97. END
  98.  
  99. /* All questions done, now get on with it */
  100. /* First clear chosen flags */
  101.  
  102. IF antwoord=1 THEN DO
  103.     'unrepliedarea'
  104.     DO UNTIL rc = 2
  105.         'messagelist'
  106.         'excludeflag ALL'
  107.         'includeflag UNREPLIED'
  108.         'clearflags UNREPLIED'
  109.         'excludeflag ALL'
  110.         'unrepliedarea'
  111.     END
  112. END
  113. IF lezen=1 THEN DO
  114.     'unreadarea'
  115.     DO UNTIL rc = 2
  116.         'messagelist'
  117.         'excludeflag ALL'
  118.         'includeflag UNREAD'
  119.         'clearflags UNREAD'
  120.         'excludeflag ALL'
  121.         'unreadarea'
  122.     END
  123. END
  124.  
  125. /* Export, Maintenance & Optimize */
  126.  
  127. 'arealist'
  128. IF exporteer=1 THEN DO
  129.     'export QUIET CLOSEWIN'
  130. END
  131. IF onderhoud=1 THEN DO
  132.     'maintenance NOREQ CLOSEWIN'
  133. END
  134. IF optimaal=1 THEN DO
  135.     'optimize NOREQ CLOSEWIN'
  136. END
  137.  
  138. /* Save settings & Quit */
  139.  
  140. 'savesettings NOREQ'
  141. 'quitspot NOREQ'
  142. EXIT
  143.