	SUBROUTINE GETSEND(CMD_LINE)
C
C	GETSEND.FOR
C
C	These routines perform the GET and SEND functions to and
C	from a remote CPU.
C
C	Roger Lipsett	INTERMETRICS	APRIL 27, 1979
C
C	Rewritten by:
C	Robin Miller at Project Software & Development, Inc.  1981
C
	INCLUDE 'COM.INC/NOLIST'

	CHARACTER*(*) CMD_LINE

	LOGICAL I, INIT_REMOTE, GET_FILE, SEND_FILE

	CALL FLUSH_LOGFILE()		! Empty the logfile buffer.
	IN_A_COMMAND = .TRUE.		! Show command in progress.
	CALL REENABLE()			! Enable CTRL/C AST's.
	VSIZE = 0			! Show no VAX file name.
	RSIZE = 0			!  and no REMOTE file name.

	IF (.NOT. INIT_REMOTE()) THEN	! Initialize the SNDRCV program.
		GO TO 9900		! Didn't get handshaking started.
	ENDIF
C
C	Initiate the GET or SEND function.
C
	IF (FLOW .EQ. IN) THEN
		I = GET_FILE(CMD_LINE)	! Get file from remote.
	ELSE
		I = SEND_FILE(CMD_LINE)	! Send file to remote.
	ENDIF
	IF (CONTROLC_TYPED) THEN	! Was CTRL/C typed to abort ?
		CALL SEND_CAN()		! Yes, tell remote to abort.
	ENDIF
1100	IF (I) THEN
		CALL PRTFINAL()
		CALL WRITE_USER(SS//
	1		'*** File transmission is complete. ***'//SS)
	ELSE
		CALL WRITE_USER(SS//
	1		'*** File transmission has been aborted. ***'//SS)
	ENDIF

	CALL ELAPSED_TIME()		! Display the elapsed time.
	CLOSE (UNIT=FILE_UNIT)		! Save whatever we transmitted.
9900	IN_A_COMMAND = .FALSE.		! No longer in a command.
	RETURN
	END
