home *** CD-ROM | disk | FTP | other *** search
/ Current Shareware 1994 January / SHAR194.ISO / modem / jbtutor1.zip / LESSON13.TXT < prev    next >
Text File  |  1993-09-21  |  4KB  |  72 lines

  1.  
  2. Enhancement #2 -- Delete your .REP after successful upload
  3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  4.  
  5.         Once your .REP has been successfully imported by the BBS,
  6. you may want the script to go ahead and delete the .REP.  This will
  7. prevent accidental upload of duplicate messages during subsequent
  8. mailrun sessions.  While most mail readers will prompt you on whether
  9. or not to delete the .REP, I think it's better to have the script
  10. take care of this for you automatically for a couple reasons:
  11.  
  12.         a.  It's possible to err when prompted by the mail reader by
  13.             not deleting a .REP that should be deleted.
  14.  
  15.         b.  If, for some reason, your .REP was uploaded to the BBS,
  16.             but *wasn't* successfully imported to the BBS message
  17.             base, then you'd probably want to upload it again next
  18.             mailrun session.  In this case, you might make the
  19.             mistake of deleting the .REP when prompted by your mail
  20.             reader.  If the script is setup to delete the .REP upon
  21.             successful upload/import, then you can *always* safely
  22.             answer "No" to the mail reader prompt if it ever appears.
  23.  
  24.         Before you can code the section of your script that will
  25. delete uploaded .REPs, you need to determine what feedback the
  26. specific BBS provides on uploaded messages.  This feedback is
  27. normally in the form of a one line message something to the effect of
  28. "Upload Successful" or "Finished Importing 4 Messages" or "Importing
  29. Message Into {COMMO} Conference".  For the sake of this lesson, let's
  30. assume the message is "Mail Upload Successful!".  Here's an example
  31. of how you could code your script to automatically delete the .REP:
  32. .
  33. .
  34. {:MAIL}                                       (mail subroutine macro id)
  35.     {SETL 180,gby,,}                          (initialize "look" to 3 min)
  36.     {GOLO gby,^jNO CARRIER^m}                 (error trap if carrier lost)
  37.     {LOOK Command?}                           (wait for mail door prompt)
  38.     {IFEX %repdir%%bbsid.rep,,send_d}         (chk 2 see if .REP exists)
  39.     {SEND u|}                                 (.REP exists, send "u<cr>")
  40.     {GOLO gby,^jNO CARRIER^m}                 (error trap if carrier lost)
  41.     {LOOK ^XB01}                                  (wait for ZModem string)
  42.     {EXEC dsz port %_por sz %repdir%%bbsid.rep}      (exec ZModem send)
  43.     {CALO ul_end,del_rep,Mail Upload Successful!}    (branch on msg)
  44.   {:UL_END}                                       (return point for "CALO")
  45.     {GOLO gby,^jNO CARRIER^m}                  (error trap if carrier lost)
  46.     {LOOK Command?}                            (mail door prompt after ul)
  47.   {:SEND_D}                                    (mail dl macro id)
  48.     {SEND d|}                                  (send "d<cr>" to mail door)
  49. .                                              (remainder of script)
  50. .
  51.   {:DEL_REP}                                  (.REP delete routine macro ID)
  52.     {EXEC del %repdir%%bbsid.rep}             (delete the .REP packet)
  53.     {RETU}                                    (returns to "ul_end" since
  54.                                               that is point specified by
  55.                                               "CALO" command)
  56. ------------
  57.         As you can see, the "del_rep" sub-routine will only be
  58. executed upon receipt of the "Mail Upload Successful!" string.  If
  59. the string isn't received, then the .REP will not be deleted.
  60.  
  61.         Remember:  before coding a similar routine, be sure you know
  62. the *precise* message the BBS will send following a successful
  63. upload/import of your replies.  If you remember the lesson where I
  64. mentioned "Minimalized prompts", the same technique could apply to
  65. the "success message", i.e., you may use as much/little of the
  66. "success" message for your trigger that would set it apart from other
  67. random occurring text.  In the example above, "Successful!" may be
  68. enough..then again, you might need the full string.  That's up to you
  69. to decide.  We're only talking a few bytes here..
  70.  
  71. Jim
  72.