GMPLUTL4 ; SLC/KER -- PL Utilities (Misc) ; 04/15/2002
;;2.0;Problem List;**26**;Aug 25, 1994
;
; External References
; DBIA 10096 ^%ZOSF("TEST")
;
; Variable Used but NEWed/KILLed Elsewhere
; IOT, ORWINDEV
;
PTR(X) ; Output to Printer
; 1 = Yes
; 0 = No
Q:+($$VISTA)>0!(+($$HFP)>0) 1
Q 0
;
VISTA(X) ; Vista Printer
Q:$E($G(ION),1,3)="NUL" 0 Q:$G(IOT)'="HFS"&($E($G(IOST),1,2)["P-")&($G(IOST)'="P-OTHER") 1
Q 0
;
HFP(X) ; Host File sent to Printer
; Check ORWINDEV
N GMTS85 S GMTS85=$$PROK("ORWRP",85)
Q:+($G(GMTS85))>0&(+($G(ORWINDEV))>0) 1
; Check Host File Server
Q:$G(IOT)'="HFS" 0
; Host File for GUI Scrollable Window
Q:$E($G(ION),1,14)["OR WORKSTATION" 0
; TCP/IP Printer
Q:$G(IO)["$PRT"!($G(IO)["PRN|") 1
; Windows Printer
Q:$E($G(ION),1,14)["OR WINDOWS HFS" 1
; Host Files (file or unspecifed printer)
Q 0
;
; Miscellaneous
PROK(X,Y) ; Routine and Patch # OK
N GMTS,GMTSI,GMTSO S X=$G(X),Y=$G(Y) Q:'$L(X) 0 Q:Y'=""&(+Y=0)
S Y=+Y,GMTS=$$ROK(X) Q:'GMTS 0 Q:+Y=0 1 S GMTSO=0,GMTS=$T(@("+2^"_X)),GMTS=$P($P(GMTS,"**",2),"**",1)
F GMTSI=1:1:$L(GMTS,",") S:+($P(GMTS,",",GMTSI))=Y GMTSO=1 Q:GMTSO=1
S X=GMTSO Q X
ROK(X) ; Routine OK (in UCI)
S X=$G(X) Q:'$L(X) 0 Q:$L(X)>8 0 X ^%ZOSF("TEST") Q:$T 1 Q 0
GMPLUTL4 ; SLC/KER -- PL Utilities (Misc) ; 04/15/2002
+1 ;;2.0;Problem List;**26**;Aug 25, 1994
+2 ;
+3 ; External References
+4 ; DBIA 10096 ^%ZOSF("TEST")
+5 ;
+6 ; Variable Used but NEWed/KILLed Elsewhere
+7 ; IOT, ORWINDEV
+8 ;
PTR(X) ; Output to Printer
+1 ; 1 = Yes
+2 ; 0 = No
+3 IF +($$VISTA)>0!(+($$HFP)>0)
QUIT 1
+4 QUIT 0
+5 ;
VISTA(X) ; Vista Printer
+1 IF $EXTRACT($GET(ION),1,3)="NUL"
QUIT 0
IF $GET(IOT)'="HFS"&($EXTRACT($GET(IOST),1,2)["P-")&($GET(IOST)'="P-OTHER")
QUIT 1
+2 QUIT 0
+3 ;
HFP(X) ; Host File sent to Printer
+1 ; Check ORWINDEV
+2 NEW GMTS85
SET GMTS85=$$PROK("ORWRP",85)
+3 IF +($GET(GMTS85))>0&(+($GET(ORWINDEV))>0)
QUIT 1
+4 ; Check Host File Server
+5 IF $GET(IOT)'="HFS"
QUIT 0
+6 ; Host File for GUI Scrollable Window
+7 IF $EXTRACT($GET(ION),1,14)["OR WORKSTATION"
QUIT 0
+8 ; TCP/IP Printer
+9 IF $GET(IO)["$PRT"!($GET(IO)["PRN|")
QUIT 1
+10 ; Windows Printer
+11 IF $EXTRACT($GET(ION),1,14)["OR WINDOWS HFS"
QUIT 1
+12 ; Host Files (file or unspecifed printer)
+13 QUIT 0
+14 ;
+15 ; Miscellaneous
PROK(X,Y) ; Routine and Patch # OK
+1 NEW GMTS,GMTSI,GMTSO
SET X=$GET(X)
SET Y=$GET(Y)
IF '$LENGTH(X)
QUIT 0
IF Y'=""&(+Y=0)
QUIT
+2 SET Y=+Y
SET GMTS=$$ROK(X)
IF 'GMTS
QUIT 0
IF +Y=0
QUIT 1
SET GMTSO=0
SET GMTS=$TEXT(@("+2^"_X))
SET GMTS=$PIECE($PIECE(GMTS,"**",2),"**",1)
+3 FOR GMTSI=1:1:$LENGTH(GMTS,",")
IF +($PIECE(GMTS,",",GMTSI))=Y
SET GMTSO=1
IF GMTSO=1
QUIT
+4 SET X=GMTSO
QUIT X
ROK(X) ; Routine OK (in UCI)
+1 SET X=$GET(X)
IF '$LENGTH(X)
QUIT 0
IF $LENGTH(X)>8
QUIT 0
XECUTE ^%ZOSF("TEST")
IF $TEST
QUIT 1
QUIT 0