home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / BBS / MISC / SCRIPTS.ZIP / RMAUPL.T < prev    next >
Encoding:
Text File  |  1991-10-08  |  2.4 KB  |  87 lines

  1.     :: Upload message to RemoteAccess  Rev 9-25-91
  2.     :: First line used is "From : name" (reply) or "To name" (originating)
  3.     ::  -- The absence of a colon after the "To" distinguishes originating
  4.     ::  -- messages from reply messages.
  5.     :: Next 2 lines are searched for "Subject :"
  6.     :: Message body starts on next line
  7.     ::
  8.     on !c goto foonc
  9.     pat
  10.     open -!tg %item; set s0 ""
  11.     while "t&&!%s0" grab s0        :: read past initial blank lines
  12.     if !t goto foobar
  13.     if "js0,Message" grab s0
  14.     if "js0,Prefix" grab s0
  15.     if "js0,Date" grab s0
  16.     if "js0,To " goto orig        :: Sanity check first non blank line
  17.     if "!js0,From" goto foobar    :: Sanity check first non blank line
  18.     :: parse addressee
  19. orig:    split s0 " :" "" 
  20.     sets s1 "%z1"
  21.     ss s1 "(.*)(           *)"
  22.     while %z2 sets s1 "%z1" ss s1 "(.*)( $)"
  23.     ss s1 "(^:* *)(.*)";  if %z1 sets s1 "%z2"
  24.  
  25.     :: parse subject
  26.     grab s2            :: If to line - ignore
  27.     ss s2 "(R[eE]: *|Subject *: *)(.*)"
  28.     if !%z2 grab s2;  ss s2 "(R[eE]: *|Subject *: *)(.*)"
  29.     if !%z2 grab s2;  ss s2 "(R[eE]: *|Subject *: *)(.*)"
  30.     sets s2 "%z2"
  31.     ss s2 "(R[eE]: *|Subject *: *)(.*)"
  32.     if %z2 ss s2 "(R[eE]: *|Subject *: *)(.*)";  sets s2 "%z2"
  33.     ss s2 "(.*)(           *)"
  34.     while %z2 sets s2 "%z1" ss s2 "(.*)( $)"
  35.     ss s2 "(^ *)(.*)";  if %z1 sets s2 "%z2"
  36.     echoc "TO: <%s1> SUBJECT: <%s2>"
  37.  
  38.     :: parse possible Replies line, discard
  39.     grab s0;  if "js0,Replies" grab s0
  40.     : return        :: for local testing of argument parsing
  41.     if "js2,sysop" echoc "Cannot send echo msg to sysyop"; goto foobar
  42.     put "e"
  43.     :pat 3c "From    :" "%n1 %n2\r"
  44.     pat 4c "To      :" "%s1\r"
  45.     pat 5c "Subject :" "%s2\r"
  46.     pat 6c "Change anything <y/N> :" "n"
  47.     pat 7c "a prepared message <y/N>?" "n"
  48.     pat 9c "<=> non-stop" "="
  49.     set blankfill " - "
  50.     wait -f3
  51.     ena -pt; pq1; pp120; pg:
  52.     if %s0 putv s0; put "\r"
  53.     t -gx; ena -t!p
  54.     put "\r"
  55.     pat 7c "Select:" "s\r"
  56.     pat 8i "Saving message to disk"
  57.     pat 9c "<=> non-stop" "="
  58.     wait
  59.     if "!8" goto foobar
  60.      :::... (#7051)
  61.  
  62.  
  63. done:    if !dv "!%mv %item Z%item.tmp"
  64.     if dv "!%rename %item Z%item.tmp"
  65.     echoc "File Uploaded: %item moved to Z%item.tmp"
  66.     ena -gt
  67.     wait -f2
  68.     pat
  69.     return
  70. foonc:    echoc "Carrier Lost"
  71. foobar:    echoc "File Not Accpeted"
  72.     nolog closetx
  73.     pat
  74.     return
  75. foox:    echoc "Moving %item to Y%item.tmp"
  76.     if !dv "!%mv %item Y%item.tmp"
  77.     if dv "!%rename %item Y%item.tmp"
  78.     ena -gt
  79.     nolog closetx
  80.     echoc "RMAUPL ABEND"
  81.     pat
  82.     return
  83. unedited:    echoc "rmaupl.t: %item has not been edited!"
  84.     closetx
  85.     pat
  86.     return
  87.