home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Black Box 4
/
BlackBox.cdr
/
comfiles
/
bgft211.arj
/
BGFTUITL.SLT
< prev
next >
Wrap
Text File
|
1991-05-02
|
6KB
|
117 lines
// BGFTUITL.SLT: Telix script for BGFT Xmodem-1K upload.
// Support Package for Registered Users of BGFT (TM).
// Copyright 1990-1991 Dirac Systems.
// Telix is a trademark of Exis Inc.
// Operation of this script is made a little complicated due to
// the different ways that Telix and BGFT do uploads. To satisfy
// BGFT's needs, the file to be uploaded must be in the file buffer.
// This is best done by moving files with BGFT.EXE; but it can also
// be done with BGFTOPT /m<filename> if desired. Also, to satisfy
// Telix, the same named file must be in its default upload directory.
// Telix must be able to open the file before it calls this script to
// make sure it exists in its upload directory; if Telix cannot find
// the file it will announce 'No Matching File(s)'. Telix will not
// actually do anything with the file it opens for upload,
// as BGFT will send the file in the file buffer.
// MANUAL INSTALLATION:
// The following outlines how to install the script for use as an
// external protocol in Telix:
// Be sure that the resident part (BGFT360K.COM or BGFT720K.COM) of
// BGFT is loaded before the communications program. Add /B if
// you want Drive B:. The BGFT status window does not need to be
// active; it need only be resident.
// The batch file BGFTINIT.BAT is used to initialize BGFT prior to
// running Telix. This file must be edited to contain information
// about your modem's port number and baud rate prior to use
// (default is 1200 baud, port 1). You must run the batch file
// BGFTINIT.BAT to make sure that BGFT is set up properly. THIS
// MUST BE DONE before using BGFT as an external protocol under
// Telix. This is true even though the baud and port are set here.
// Put the right sized floppy (.720, 1.2, or 1.44 Megabyte DOS
// formatted, no errors for BGFT720K.COM ; the above or 360K DOS
// formatted, no errors for BGFT360K.COM) into the desired floppy
// drive. The floppy size must correspond to the drive type.
// Compile the BGFTUITL.SLT by using the Telix compiler, CS, viz.
// CS BGFTUITL
// This will produce BGFTUITL.SLC for use in Telix.
// From terminal mode do 'Alt_O' for 'Configure Telix'.
// Choose 'Protocol Options'.
// 'Change which setting?': Choose one of the four external protocol
// options: A, B, C, or D.
// Key: When in the upload operation, pressing this key will choose
// the protocol. The key should not be used elsewhere, eg. X (Xmodem).
// Choose 'I', for example. It will be highlighted for the Telix
// upload operation.
// Protocol name: This is what will show up in the list of protocols when
// you choose the upload operation. Call it, 'BGFTImdm'.
// Upload file name: Enter, BGFTUITL. This will be the compiled script.
// Download file name: You could use the file BGFTDXTL.SLT since it will
// receive the -1K as well as the CRC Xmodem.
// BAT or Script: Choose 'Script' since BGFTUITL.SLT is a script.
// DL name: Choose 'Y' for yes since you want Telix to pass the name of the
// file to the script. The script will get rid of Telix's upload
// directory since BGFT only wants to put the filename on the floppy.
// ESC out of the screen and save the set up to disk by hitting 'W'. This
// get you back into Telix terminal mode.
// Upload as you normally would (PgUp); tell the host to send via Xmodem-1K.
// Choose the BGFTImdm protocol using arrows plus an ENTER or by the Key
// defined above.
// The script will give some messages, start the background transfer, and
// exit Telix. You will be at the DOS prompt.
// You should see the BGFT window indicate normal transmission.
// Now you can do your work in foreground as the file is uploaded in
// background.
// After completion you can use BGFT.EXE to move your files to some DOS
// directory. The files are ready to use.
// Use BGFTOPT /3<Pathname> to dump downloaded files from the file buffer
// to a specified directory.
//
str command[80]; // Command string for BGFTOPT.
str temp[80]; // Temporary concatenation string.
int updirlen; // Telix upload drive:directory str length.
int extfilelen; // Telix external file maximum str length.
// The command we will issue to DOS is:
// BGFTOPT /q /a /r# /b# /~4 /uFn /s
// where:
// /q - quiet mode (don't printout results)
// /a - acknowledge any error that may be present
// /r# - select port # (eg. /r1)
// /b# - select baud # (eg. /b2400)
// /~4 - select protocol 4: Xmodem-1K upload
// /uFn - set upload filename Fn (eg test.tst)
// /s - start the transfer
main()
{
command = "/q"; // Start command line.
strcat(command," /a"); // Acknowledge any error.
strcat(command," /r");
itos(get_port(),temp); // Find out where we are connected.
strcat(command,temp); // Reconnect existing comm port.
strcat(command," /b");
itos(get_baud(),temp); // Find out what is the baud rate.
strcat(command,temp); // Set baud rate for resident.
//
// BGFT requires a filename from Telix.
//
strcat(command," /u"); // Set up upload.
updirlen = strlen(_up_dir); // Get unwanted Telix upld directory.
extfilelen = strmaxlen(_ext_filespec); // Get maximum length of Telix file.
substr(_ext_filespec,updirlen,extfilelen,temp); // Shave off upld dir.
strcat(command,temp); // Put BGFT filename in '/u' command.
//
// Xmodem-1K Upload
//
strcat(command," /~4"); // This protocol is Xmodem-1K upload.
strcat(command," /s"); // Start to send file.
prints(command); // Tell user the command string.
run("bgftopt.exe",command,2);
exittelix(0,0); // Leave Telix; don't hangup line.
} // Now enjoy background Xmodem-1K upld.