Johnny,
Using your [IPF77]TEST2.FTN, I made a very simple network printing routine that I can
begin to modify for a Brother Laser printer which
will have its own escapes codes for portrait, landscape etc. and pull file names from the
command line. I show it below in case any one wants to do something similar. I used your
MKE and MAKEFILE,; to handle getting the libraries and switches correct.
PROGRAM NETPRT
INCLUDE 'INET'
CHARACTER*40 HOST, URL, FIL
CHARACTER*1 TXT(132)
CHARACTER*6 EP
INTEGER*2 LPO, I, L, K, PORT
HOST='192.168.0.27'
PORT=9100
LPO = TCP(1,0)
IF (HOST2I(EP,6,HOST,40,PORT) .NE. 0) THEN
TYPE *,'Failed to convert hostname.'
CALL EXIT(1)
END IF
IF (CONNEC(1,EP,6,PUTXT,60) .NE. 0) THEN
TYPE *,'Connect error: ',NETERR
CALL EXIT(1)
END IF
CALL GEP(1,EP,6)
IF (IP2HOS(EP,6,RNADR+RPORT,HOST,40) .NE. 0) THEN
TYPE *,'IP2HOST error: ',NETERR
CALL EXIT(1)
END IF
TYPE *,'Got connection - ',HOST
WRITE(5,30)
30 FORMAT('$FILE:')
READ (5,20) FIL
20 FORMAT(A40)
L = INDEX(FIL,' ')-1
OPEN (UNIT=2, FILE=FIL(1:L), STATUS='OLD', FORM='FORMATTED',
+ CARRIAGECONTROL='LIST', READONLY)
40 READ (2,45,END=100) K, (TXT(I),I=1,K)
45 FORMAT(Q,132A1)
D WRITE (5,50) (TXT(I),I=1,K)
WRITE (1,50) (TXT(I),I=1,K)
50 FORMAT(1X,132A1)
GOTO 40
100 CONTINUE
CALL PCRLF(1)
CALL PUSH(1)
CALL SCLOSE(1)
CLOSE (UNIT=2)
TYPE *,'Net Print Done.'
END
Thanks and Best regards,
Mark