home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS - Coast to Coast
/
simteldosarchivecoasttocoast2.iso
/
pibterm
/
pibt41e3.zip
/
SENDMLIN.SCR
< prev
next >
Wrap
Text File
|
1988-02-26
|
4KB
|
100 lines
***************************************************************************
* S E N D M L I N . S C R --- Script interfacing MLINK to PibTerm *
***************************************************************************
* *
* Script: SendMLin.Scr *
* *
* Purpose: Interfaces external Megalink driver program MLINK.COM *
* to PibTerm for sending files. *
* *
* Invocation: *
* *
* Execute "SendMLin" *
* *
* Remarks: *
* *
* This script is designed to be automatically invoked by the *
* <ALT>S command when MegaLink has been defined as an external *
* protocol at <ALT>P, F)ile transfer, k) external file transfers. *
* *
***************************************************************************
* *
* File spec for files to transfer
Declare FileSpec String
* Baud rate for transfer
Declare BaudRate String
* Comm port number
Declare Port String
* Build MLink invocation line in this
Declare Mlink String
* Host mode flag
Declare HostMode String
* Upload directory
Declare UpDir String
*
**************************************************************************
* StripPath --- procedure to strip path from file name *
**************************************************************************
*
PROCEDURE StripPath
*
Declare I Integer
Declare L Integer
Declare Ch String
*
IF ( ( INDEX( '\' , FileSpec ) <> 0 ) OR ( INDEX( ':' , FileSpec ) <> 0 ) ) THEN
*
L = LENGTH( FileSpec )
I = L
*
REPEAT
I = I - 1
Ch = Substr( FileSpec, I, 1 )
UNTIL ( ( Ch = '\' ) OR ( Ch = ':' ) )
*
FileSpec = SUBSTR( FileSpec, I + 1 , L - I )
*
ENDIF
*
ENDPROC StripPath
*
**************************************************************************
* SendMLin -- Main Routine *
**************************************************************************
*
* Find out if we're in host mode
*
GetParam 'HP' HostMode
* Get port number
GetParam 'PO' Port
* Get baud rate
GetParam 'BA' BaudRate
* Get file spec
GetParam 'FN' FileSpec
* Get host mode directory, and
* prepend to file spec, after
* stripping any other directory spec.
IF ( HostMode = 'N' ) THEN
GetParam 'HD' UpDir
Call StripPath
Set FileSpec = CONCAT( UpDir , FileSpec )
ENDIF
* Build MLink invocation line
*
Set Mlink = CONCAT( 'MLink port ' , Port )
Set Mlink = CONCAT( CONCAT( Mlink , ' speed ' ), BaudRate )
Set Mlink = CONCAT( CONCAT( Mlink , ' SM ' ), FileSpec )
*
* Echo built line to screen
Writeln " "
Writeln "Invoking MLink as follows:"
Writeln Mlink
Writeln " "
* Echo Mlink line to capture file
*
Writelog "Invoking MLink as follows:"
Writelog Mlink
* Call MLink
Dos Mlink
*