home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / pibterm / pibt41e3.zip / RECZMOD.SCR < prev    next >
Text File  |  1988-02-26  |  4KB  |  91 lines

  1. ***************************************************************************
  2. *       R E C Z M O D . S C R --- Script interfacing DSZ to PibTerm       *
  3. ***************************************************************************
  4. *                                                                         *
  5. *    Script:  RecZMod.Scr                                                 *
  6. *                                                                         *
  7. *    Purpose: Interfaces external Zmodem driver program DSZ.COM           *
  8. *             to PibTerm for receiving files.                             *
  9. *                                                                         *
  10. *    Invocation:                                                          *
  11. *                                                                         *
  12. *       Execute "RecZmod"                                                 *
  13. *                                                                         *
  14. *    Remarks:                                                             *
  15. *                                                                         *
  16. *       This script is designed to be automatically invoked by the        *
  17. *       <ALT>R command when Zmodem has been defined as an external        *
  18. *       protocol at <ALT>P, F)ile transfer, k) external file transfers.   *
  19. *                                                                         *
  20. ***************************************************************************
  21. *                                                                         *
  22. *                                  Baud rate for transfer
  23.    Declare BaudRate String
  24. *                                  Comm port number
  25.    Declare Port     String
  26. *                                  Build DSZ invocation line in this
  27.    Declare Zmodem   String
  28. *                                  Saves drive/directory we're in now
  29.    Declare CurDrive String
  30.    Declare CurDir   String
  31. *                                  Download directory
  32.    Declare DownDir  String
  33. *                                  Length of download directory
  34.    Declare L        Integer
  35. *                                  Host mode flag
  36.    Declare HostMode String
  37. *                                  "Restrict" for host mode, else null
  38.    Declare Restrict String
  39. *                                  Get directory we're in now
  40.    GetDir CurDrive CurDir
  41. *                                  Get port number
  42.    GetParam 'PO' Port
  43. *                                  Get baud rate
  44.    GetParam 'BA' BaudRate
  45. *                                  Find out if we're in host mode
  46. *
  47.    GetParam 'HP' HostMode
  48. *                                  Get download directory.
  49. *                                  If in host mode, use host mode upload
  50. *                                  directory.
  51. *
  52.    Set Restrict = ''
  53. *
  54.    IF ( HostMode = ' ' ) THEN
  55.       GetParam 'DD' DownDir
  56.    ELSE
  57.       GetParam 'HU' DownDir
  58.       IF ( HostMode = 'N' ) THEN
  59.          Set Restrict = 'restrict '
  60.       ENDIF
  61.    ENDIF
  62. *                                  Strip final '\' if any from download dir
  63.    Set L = LENGTH( DownDir )
  64. *
  65.    IF ( Substr( DownDir, L, 1 ) = '\' ) THEN
  66.       Set DownDir = Substr( DownDir, 1, L - 1 )
  67.    ENDIF
  68. *                                  Move to download directory
  69.    Chdir     DownDir
  70. *                                  Build DSZ invocation line
  71. *
  72.    Set Zmodem = CONCAT( 'DSZ port ' , Port )
  73.    Set Zmodem = CONCAT( CONCAT( Zmodem , ' speed ' ), BaudRate )
  74.    Set Zmodem = CONCAT( CONCAT( CONCAT( Zmodem , ' d ' ), Restrict ), 'rz -y')
  75. *
  76. *                                  Echo Zmodem line to screen
  77.    Writeln " "
  78.    Writeln "Invoking DSZ as follows:"
  79.    Writeln Zmodem
  80.    Writeln " "
  81. *                                  Echo Zmodem line to capture file
  82.    Writelog "Invoking DSZ as follows:"
  83.    Writelog Zmodem
  84. *                                  Call DSZ
  85.    Dos Zmodem
  86. *                                  Return to original directory
  87. *
  88.    Set CurDir = CONCAT( CONCAT( CurDrive , ':\' ), CurDir )
  89. *
  90.    Chdir CurDir
  91.