[net.micro] IBM PC speaks to unix

ctk (09/09/82)

  I have finally figured out how to upload and download to/from unix
using the IBM ACS program. The following two routines do that. Use and
enjoy.
  In order to use the routines you must do the following:

	1. Use full dup. with local character echoing. This means the
	   -stty echo command must be given to unix.

	2. Erase lines 16499-16915. The lines of code given below are
	   the upload/download routines together with a few patches for
	   the main program needed to get the thing to work. This code
	   can simply be MERGEd into the program after step 1.

	3. Press <F7> to download, <F8> to upload. To upload you must
	   be in edit mode. The program asks you for a character (i or a)
	   to send to the host machine to put it in input mode then takes
	   over. You must get out of input and save the file yourself. The
	   download program asks you two nonobvious questions. My answers are
	   usually <CR> and "cat filename".


       If you find bugs or make inprovements let me know via mail or
       by writing to me at:
                             C.T. Kelley
                             Dept. of Math.
                             N.C.S.U.
                             Raleigh, N.C. 27650

1806 CX$=CHR$(&H1F): BEL$=CHR$(7): DOWN$=CHR$(65)
1807 CTRC$=CHR$(3):NMES$=CHR$(61): UP$=CHR$(66)
5220 IF K$=DOWN$ THEN GOTO 16500
5223 IF K$=UP$ THEN GOTO 17001
14816 IF DTST AND LEFT$(RB$,1)=L$ THEN B$=L$+CR$:RETURN
16500 'Download Routine
16515 PRINT "What is terminal character? (default is %)"
16516 INPUT L$:IF L$="" THEN L$="%"
16520 PRINT "What is name of DEST file for download?"
16530 INPUT X$:IF X$="" THEN GOTO 3400
16535 PRINT "WHAT IS MESSAGE TO HOST?":INPUT F$
16540 GOSUB 20300:GOSUB 13850:LOCATE 25,1:PRINT "DOWNLOAD ACTIVE"
16545 IF M$<>"" THEN PRINT M$:GOTO 17000
16547 GOSUB 14900
16550 GOSUB 14880:PRINT B$:DTST=TRUE:GOSUB 13600
16553 K$=LEFT$(B$,1):IF K$=L$ AND LEN(B$)=2 THEN GOTO 17000
16554 K$=INKEY$:IF LEN(K$)=0 THEN GOTO 16550 ELSE GOTO 17000
17000 CLOSE #2:LOCATE 25,1:PRINT SPACE$(60):DTST=FALSE:GOTO 18500
17001 ' Upload routine
17002 PRINT "What is the name of the Local File ";:PRINT "you wish to Upload?"
17003 INPUT X$:IF X$="" GOTO 3400
17005 PRINT "What is character to be sent to host?":INPUT F$
17006 GOSUB 14900:GOSUB 17080
17015 LOCATE 25,1:PRINT "UPLOAD ACTIVE"
17020 GOSUB 20300:GOSUB 13800
17025 IF M$<>"" THEN PRINT M$:GOTO 17000
17030 IF EOF(2) THEN GOTO 17000
17035 K$=INKEY$:IF LEN(K$)>0 THEN GOTO 17000
17040 LINE INPUT#2,RT$
17050 IF LEN(RT$)>240 THEN PRINT "Not ascii.":GOTO 17000
17060 F$=RT$:IF F$="" THEN F$=" "
17065 PRINT B$;F$:GOSUB 14900:GOSUB 17080:GOTO 17030
17080 B$=""
17090 CALL RC(C%,LN%,RB$,E%):IF E%>-1 THEN GOSUB 3950
17100 IF LN%<>0 GOTO 17500
17200 GOSUB 2590:GOSUB 13385:IF IE2 THEN RETURN
17300 GOTO 17090
17500 B$=B$+LEFT$(RB$,LN%)
17510 Z$=RIGHT$(B$,1)
17520 IF Z$<>":" GOTO 17090
17530 RETURN
18500 PRINT "Hit <CR> to return to terminal."
18510 INPUT M$
18520 GOTO 3400