home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / PMCROSE.ZIP / ROSE.CMD
Encoding:
Text File  |  1991-10-14  |  3.8 KB  |  92 lines

  1. /********************************************************************/
  2. /*  Rose Media Connection Script                                    */
  3. /*                                                                  */
  4. /*  This script is a PMComm 1.09 Rexx script for connecting to Rose */
  5. /*  Media.  It will automatically open the Rose Mail door, upload   */
  6. /*  any reply packet that may be in your \dlx directory, and        */
  7. /*  download messages.                                              */
  8. /*                                                                  */
  9. /*  Note:  If both a reply packet and mail packet exist on your     */
  10. /*         system, the reply packet will be uploaded and deleted,   */
  11. /*         but a message packet will not be downloaded.             */
  12. /*         If a message packet only already exists, it will be      */
  13. /*         deleted, and a new packet downloaded.                    */
  14. /*         This behaviour can be changed easily if desired, but I   */
  15. /*         like it that way!                                        */
  16. /*                                                                  */
  17. /*  N.B.:  This script requires the Rexx Utilities from             */
  18. /*            Pedagogic Software                                    */
  19. /*            W. David Ashley                                       */
  20. /*            5 Timberline Dr.                                      */
  21. /*            Trophy Club, Tx 76262                                 */
  22. /*         in order to work.  These are available on Rose as        */
  23. /*         REXUTL21.ZIP in their most recent incarnation.           */
  24. /********************************************************************/
  25.  
  26. Signal ON SYNTAX NAME SYNTAX_ERROR
  27.  
  28. Parse arg port portname screen_handle dde_output dde_input semaphore
  29. Parse source . . fn .
  30.  
  31. /* This function registers the init_dll function with REXX. The */
  32. /* init_dll function will register the rest of the functions in */
  33. /* the rxpmcomm.dll. */
  34.  
  35. Call RxFuncAdd "init_dll","RxPmcomm","init_dll"
  36. call RxFuncAdd 'RexFileExist','RexxUtil','RexFileExist'
  37. call RxFuncAdd 'RexDelete','RexxUtil','RexDelete'
  38.  
  39. /* Required before any other rxpmcomm.dll functions are called. */
  40. Call init_dll
  41. cr   = '0d'x
  42. crlf = '0a0d'x
  43. Call read_timeout "600000",port
  44.  
  45. Call wait_fore "ter)=no? ","raw",port,screen_handle
  46. Call put_s "n q ns
  47. ",port
  48. Call wait_fore "st name? ","raw",port,screen_handle
  49. Call put_s "tom koschate c0venant
  50. ",port
  51. Call wait_fore "er)=yes? ","raw",port,screen_handle
  52. Call put_s "n
  53. ",port
  54. Call wait_fore "Command? ","raw",port,screen_handle
  55. Call put_s "open 1
  56. ",port
  57. Call wait_fore "?=help): ","raw",port,screen_handle
  58. if RexFileExist('c:\dlx\rose.rep') then do
  59.     call put_s "u
  60. ",port
  61.     call wait_fore "DSZ ZModem","raw",port,screen_handle
  62.     call zmodem_send "c:\dlx\rose.rep",dde_output,dde_input
  63.     call RexDelete 'c:\dlx\rose.rep'
  64.     Call wait_fore "?=help): ","raw",port,screen_handle
  65.     if RexFileExist('c:\download\rose.qwk') then do
  66.       Call put_s "g
  67. ",port
  68.       Exit
  69.     end
  70.     else nop
  71.   end
  72.   else nop
  73.   
  74. if RexFileExist('c:\download\rose.qwk') then call RexDelete 'c:\download\rose.qwk'
  75. else nop
  76.  
  77. call RxFuncDrop 'RexFileExist'
  78. call RxFuncDrop 'RexDelete'
  79.   
  80. Call put_s "d
  81. ",port
  82. Call wait_fore "t (Y/N)? ","raw",port,screen_handle
  83. Call put_s "y
  84. ",port
  85. Call wait_fore "DSZ ZModem","raw",port,screen_handle
  86. Call zmodem_receive dde_output,dde_input
  87. Call wait_fore "=help):","raw",port,screen_handle
  88. Call put_s "g
  89. ",port
  90. Exit 0
  91.  
  92. /* Standard handler for SIGNAL on ERROR, will help in the debuging */
  93. syntax_error:
  94. fp = filespec("path",fn)
  95. fd = filespec("drive",fn)
  96. errormsg = 'REXX error' rc 'in line' sigl':' errortext(rc)
  97. errorfile = fd||fp||"SCRIPT.ERR"
  98. rc = lineout(errorfile,date() time() fn '-' errormsg)
  99. rc = lineout(errorfile,date() time() fn '-' sourceline(sigl))
  100. Exit
  101.