home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / COMM / MISC / BGFT211.ZIP / BGFTUXTL.SLT < prev    next >
Encoding:
Text File  |  1991-05-02  |  6.0 KB  |  116 lines

  1. // BGFTUXTL.SLT: Telix script for BGFT Xmodem-CRC upload.
  2. // Support Package for Registered Users of BGFT (TM).
  3. // Copyright 1990-1991 Dirac Systems.
  4. // Telix is a trademark of Exis Inc.
  5.  
  6. // Operation of this script is made a little complicated due to
  7. //      the different ways that Telix and BGFT do uploads. To satisfy
  8. //      BGFT's needs, the file to be uploaded must be in the file buffer.
  9. //      This is best done by moving files with BGFT.EXE; but it can also
  10. //      be done with BGFTOPT /m<filename> if desired. Also, to satisfy
  11. //      Telix, the same named file must be in its default upload directory.
  12. //      Telix must be able to open the file before it calls this script to
  13. //      make sure it exists in its upload directory; if Telix cannot find
  14. //      the file it will announce 'No Matching File(s)'. Telix will not
  15. //      actually do anything with the file it opens for upload,
  16. //      as BGFT will send the file in the file buffer.
  17.  
  18. // MANUAL INSTALLATION:
  19. // The following outlines how to install the script for use as an
  20. //      external protocol in Telix:
  21. // Be sure that the resident part (BGFT360K.COM or BGFT720K.COM) of
  22. //      BGFT is loaded before the communications program. Add /B if
  23. //      you want Drive B:. The BGFT status window does not need to be
  24. //      active; it need only be resident.
  25. // The batch file BGFTINIT.BAT is used to initialize BGFT prior to
  26. //      running Telix. This file must be edited to contain information
  27. //      about your modem's port number and baud rate prior to use
  28. //      (default is 1200 baud, port 1). You must run the batch file
  29. //      BGFTINIT.BAT to make sure that BGFT is set up properly. THIS
  30. //      MUST BE DONE before using BGFT as an external protocol under
  31. //      Telix. This is true even though the baud and port are set here.
  32. // Put the right sized floppy (.720, 1.2, or 1.44 Megabyte DOS
  33. //      formatted, no errors for BGFT720K.COM ; the above or 360K DOS
  34. //      formatted, no errors for BGFT360K.COM) into the desired floppy
  35. //      drive. The floppy size must correspond to the drive type.
  36. // Compile the BGFTUXTL.SLT by using the Telix compiler, CS, viz.
  37. //      CS BGFTUXTL
  38. //      This will produce BGFTUXTL.SLC for use in Telix.
  39. // From terminal mode do 'Alt_O' for 'Configure Telix'.
  40. // Choose 'Protocol Options'.
  41. // 'Change which setting?': Choose one of the four external protocol
  42. //      options: A, B, C, or D.
  43. // Key: When in the upload operation, pressing this key will choose
  44. //      the protocol. The key should not be used elsewhere, eg. X (Xmodem).
  45. //      Choose 'B', for example. It will be highlighted for the Telix
  46. //      upload operation.
  47. // Protocol name: This is what will show up in the list of protocols when
  48. //      you choose the upload operation. Call it, 'BGFTXmdm'.
  49. // Upload file name: Enter, BGFTUXTL. This will be the compiled script.
  50. // Download file name: For this example, leave it blank.
  51. // BAT or Script: Choose 'Script' since BGFTUXTL.SLT is a script.
  52. // DL name: Choose 'Y' for yes since you want Telix to pass the name of the
  53. //      file to the script. The script will get rid of Telix's upload
  54. //      directory since BGFT only wants to put the filename on the floppy.
  55. // ESC out of the screen and save the set up to disk by hitting 'W'. This
  56. //      get you back into Telix terminal mode.
  57. // Upload as you normally would (PgUp); tell the host to send via Xmodem-CRC.
  58. // Choose the BGFTXmdm protocol using arrows plus an ENTER or by the Key
  59. //      defined above.
  60. // The script will give some messages, start the background transfer, and
  61. //      exit Telix. You will be at the DOS prompt.
  62. // You should see the BGFT window indicate normal transmission.
  63. // Now you can do your work in foreground as the file is uploaded in
  64. //      background.
  65. // After completion you can use BGFT.EXE to move your files to some DOS
  66. //      directory. The files are ready to use.
  67. // Use BGFTOPT /3<Pathname> to dump downloaded files from the file buffer
  68. //      to a specified directory.
  69. //
  70.  
  71.  
  72. str command[80];                // Command string for BGFTOPT.
  73. str temp[80];                   // Temporary concatenation string.
  74. int updirlen;                   // Telix upload drive:directory str length.
  75. int extfilelen;                 // Telix external file maximum str length.
  76.  
  77. // The command we will issue to DOS is:
  78. //              BGFTOPT /q /a /r# /b# /~1 /uFn /s
  79. //    where:
  80. //      /q    - quiet mode (don't printout results)
  81. //      /a    - acknowledge any error that may be present
  82. //      /r#    - select port # (eg. /r1)
  83. //        /b#   - select baud # (eg. /b2400)
  84. //        /~1   - select protocol 1 (Xmodem-CRC upload)
  85. //        /uFn  - set upload filename Fn (eg test.tst)
  86. //      /s    - start the transfer
  87.  
  88. main()
  89. {
  90. command = "/q";                         // Start command line.
  91. strcat(command," /a");                  // Acknowledge any error.
  92. strcat(command," /r");
  93. itos(get_port(),temp);                  // Find out where we are connected.
  94. strcat(command,temp);                   // Reconnect existing comm port.
  95. strcat(command," /b");
  96. itos(get_baud(),temp);                  // Find out what is the baud rate.
  97. strcat(command,temp);                   // Set baud rate for resident.
  98. //
  99. //      BGFT requires a filename from Telix.
  100. //
  101. strcat(command," /u");                  // Set up upload.
  102. updirlen = strlen(_up_dir);             // Get unwanted Telix upld directory.
  103. extfilelen = strmaxlen(_ext_filespec);  // Get maximum length of Telix file.
  104. substr(_ext_filespec,updirlen,extfilelen,temp);    // Shave off upld dir.
  105. strcat(command,temp);                   // Put BGFT filename in '/u' command.
  106. //
  107. //      Xmodem-CRC Upload
  108. //
  109. strcat(command," /~1");                 // This protocol is Xmodem-CRC.
  110. strcat(command," /s");                  // Start to send file.
  111. prints(command);                        // Tell user the command string.
  112. run("bgftopt.exe",command,2);
  113. exittelix(0,0);                         // Leave Telix; don't hangup line.
  114. }                                       // Now enjoy background Xmodem-CRC upld.
  115.  
  116.