Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: ZIBTCP

ZIBTCP.m

Go to the documentation of this file.
  1. ZIBTCP ; IHS/ADC/GTH - TCP PRINT TEST ; [ 02/07/97 3:02 PM ]
  1. ;;3.0;IHS/VA UTILITIES;;FEB 07, 1997
  1. ;
  1. ;
  1. ; This routine must be DONE from the CLOSE EXECUTE when
  1. ; printing to a TCP printer. See below for further
  1. ; documentation.
  1. ;
  1. ; H = Host IP address
  1. ; P = Port number
  1. ; I = Counter
  1. ;
  1. EN ;
  1. D EN1
  1. EXIT ;
  1. S ZIBX="rm XM"_ZIBH_".DAT",ZIBX=$$JOBWAIT^%HOSTCMD(ZIBX)
  1. KILL ^TMP($J,"XM"_ZIBH),ZIBH,ZIBIO,ZIBI,ZIBX
  1. Q
  1. ;
  1. EN1 ;
  1. NEW H,P,I
  1. S ZIBIO=ION,ZIBIO=$O(^%ZIS(1,"B",ZIBIO,0)),ZIBH=DUZ_$G(ZIBH)
  1. Q:'ZIBIO
  1. Q:'$D(^%ZIS(1,ZIBIO,90))
  1. S H=$P(^%ZIS(1,ZIBIO,90),U,2),P=$P(^(90),U,3)
  1. D OPEN
  1. Q:'$D(IO)
  1. U IO:(::0)
  1. F I=1:1 R X:300 S %X=$ZC Q:%X<0 S ^TMP($J,"XM"_ZIBH,I)=X
  1. D ^%ZISC
  1. O 56::99
  1. U 56::"TCP"
  1. W /SOCKET(H,P)
  1. S X=0
  1. F S X=$O(^TMP($J,"XM"_ZIBH,X)) Q:X="" W ^TMP($J,"XM"_ZIBH,X)_$C(10)_$C(13)
  1. W !,#,!
  1. C 56
  1. Q
  1. ;
  1. OPEN ;OPEN HOST FILE
  1. F ZIBI=1:1:4 S (IOP,ION)="HOST FILE SERVER #"_ZIBI,%ZIS("IOPAR")="(""XM"_ZIBH_".DAT"":""R"")" D ^%ZIS Q:'POP
  1. I POP H 2 G OPEN
  1. KILL IOP
  1. Q
  1. ;
  1. ; Technical Notes:
  1. ; MSM TCP uses the "!" to clear the TCP buffer. FileMan (RPMS)
  1. ; uses "!" for a carriage return, line feed. Further, TCP does not
  1. ; recognize "?30" as 30 spaces from left margin. To circumvent these
  1. ; problems, I write to a temporary host file, which formats the
  1. ; document, and then I read it back into the TMP global. Once it's
  1. ; in the TMP global, I $O through the global and write each line
  1. ; with a $C(10) and $C(13) concatenated to the string. This process
  1. ; handles the CR/LF problem at the remote end.
  1. ;
  1. ; Port 2501 is the assigned port from the vendor for the Net Que.
  1. ;
  1. ; As of 3Jan95, this has only been tested on the Unix platform using
  1. ; MSM. It should work in a DOS environment using FTP Software's TCP,
  1. ; but needs to be tested.
  1. ;
  1. ; Below is an inquiry of the Device file and Terminal Type file.
  1. ;
  1. ; OUTPUT FROM WHAT FILE: DEVICE//
  1. ; NAME: P-TCP TEST PRINTER $I: 51
  1. ; ASK DEVICE: YES ASK PARAMETERS: NO
  1. ; VOLUME SET(CPU): TUC SIGN-ON/SYSTEM DEVICE: NO
  1. ; FORCED QUEUING: N0
  1. ; LOCATION OF TERMINAL: MAT PARKENSON PRINTER
  1. ; ASK HOST FILE: NO MARGIN WIDTH: 255
  1. ; FORM FEED: # PAGE LENGTH: 256
  1. ; BACK SPACE: $C(8) OPEN PARAMETERS: ("XM"_DUZ_$G(ZIBH)_".DAT":"M")
  1. ; SUBTYPE: P-TCP PRINTER TYPE: HOST FILE SERVER
  1. ;
  1. ; Select TERMINAL TYPE NAME: P-TCP PRINTER
  1. ; NAME: P-TCP PRINTER SELECTABLE AT SIGN-ON: NO
  1. ; RIGHT MARGIN: 255 FORM FEED: #
  1. ; PAGE LENGTH: 256 BACK SPACE: $C(8)
  1. ; OPEN EXECUTE: S XMREC="R X#255:1" CLOSE EXECUTE: D ^ZIBTCP Q
  1. ; DESCRIPTION: Special Terminal Type used only for P-TCP Printer
  1. ; Device..