home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0010 - 0019 / ibm0010-0019 / ibm0010.tar / ibm0010 / REFLECT.ZIP / MAIL.RCL < prev    next >
Encoding:
Text File  |  1989-05-26  |  2.3 KB  |  89 lines

  1. ;
  2. ;     MAIL.RCL
  3. ;
  4. ;     Mail.rcl is a sample Reflection command file that can be used to
  5. ;     receive VAX/VMS mail and phone messages on your PC while you are
  6. ;     running another PC application program in foreground.  To use MAIL.RCL:
  7. ;
  8. ;        - run Reflection
  9. ;        - logon to your VAX/VMS system
  10. ;        - hit <Alt-F10> to bring up the command line
  11. ;        - enter 'MAIL.RCL' and hit <CR>
  12. ;
  13. ;     Reflection will then place itself in background mode and return you to
  14. ;     the DOS command prompt.  When Reflection detects that you have received
  15. ;     mail or a phone message, it will invoke either the VMS mail or phone
  16. ;     program and place itself in foreground.  Reflection will return to
  17. ;     background when you exit the VMS mail or phone utilities.  To terminate
  18. ;     the 'MAIL' command file, place Reflection in foreground with the hotkey
  19. ;     (usually <Alt-RightShift>) and enter <Ctrl-C>.
  20. ;
  21. background
  22. q command on
  23. ;
  24. ; read the host prompt into v1
  25. ;
  26. transmit "^m"
  27. readhost v1
  28. readhost v1
  29. transmit "^m"
  30. readhost v1
  31. ;
  32. ; define strings that indicate new mail and incoming phone call
  33. ;
  34. let v2 = "New mail"
  35. let v3 = "is phoning you"
  36. ;
  37. ; Main Loop - this loop is executed each time a mail or phone session
  38. ;          has been completed.
  39. ;
  40. :loop
  41. ;
  42. ; print message on screen in case user manually switches Reflection
  43. ; from background to foreground.
  44. ;
  45.   display "^[[H^[[J"
  46.   display "^[[12;13fWaiting for mail or phone ... enter <CTRL-C> to exit^m"
  47. ;
  48. ;   loop1 is repeated until a 'mail' or 'phone' message is received from
  49. ;   the host.
  50. ;
  51.   :loop1
  52.     readhost v4 until "^m"
  53. ;
  54. ;   is is a mail message?
  55. ;
  56.     if find(v2,v4) > 0
  57.       transmit 'set prompt ="wrq>>"^m'
  58.       transmit "mail^m"
  59.       wait for "MAIL>"
  60.       transmit "DIR^m"
  61.     else
  62. ;
  63. ;     is it a phone call?
  64. ;
  65.       if find(v3,v4) > 0
  66.     transmit 'set prompt ="wrq>>"^m'
  67.     transmit "phone^m"
  68.     wait for "%"
  69.     transmit "answer^m"
  70.     wait 00:00:01
  71.     transmit "^m"
  72.       else
  73. ;
  74. ;     otherwise, ignore this line.
  75. ;
  76.     goto loop1
  77.       endif
  78.     endif
  79. ;
  80. ; now, switch to foregound; wait until user returns to dcl;
  81. ; return to background; and go back for more...
  82. ;
  83.   foreground
  84.   hold for 'wrq>>'
  85.   background
  86.   transmit 'set prompt ="'&v1&'"^m'
  87.   wait for '^j'
  88.   goto loop
  89.