DDIOL ;SFISC/MKO-THE LOADER ;7SEP2011
;;22.0;VA FileMan;**168**;Mar 30, 1999;Build 27
;Per VHA Directive 2004-038, this routine should not be modified.
;
EN(A,G,FMT) ;Write the text contained in local array A or global array G
;If one string passed, use format FMT
N %,Y,DINAKED
S DINAKED=$$LGR^%ZOSV
;
S:'$D(A) A=""
I $G(A)="",$D(A)<9,$G(FMT)="",$G(G)'?1"^"1A.7AN,$G(G)'?1"^"1A.7AN1"(".E1")" Q
;
G:$D(DDS) SM
G:$D(DIQUIET) LD
;
N F,I,S
I $D(A)=1,$G(G)="" D
. S F=$S($G(FMT)]"":FMT,1:"!")
. W @F,A
;
E I $D(A)>9 S I=0 F S I=$O(A(I)) Q:I'=+$P(I,"E") D
. S F=$G(A(I,"F"),"!") S:F="" F="?0"
. W @F,$G(A(I))
;
E S I=0 F S I=$O(@G@(I)) Q:I'=+$P(I,"E") D
. S S=$G(@G@(I,0),$G(@G@(I)))
. S F=$G(@G@(I,"F"),"!") S:F="" F="?0"
. W @F,S
;
I DINAKED]"" S DINAKED=$S(DINAKED["""""":$O(@DINAKED),1:$D(@DINAKED))
Q
;
LD ;Load text into ^TMP
N I,N,T
S T=$S($G(DDIOLFLG)["H":"DIHELP",1:"DIMSG")
S N=$O(^TMP(T,$J," "),-1)
;
I $D(A)=1,$G(G)="" D
. D LD1(A,$S($G(FMT)]"":FMT,1:"!"))
;
E I $D(A)>9 S I=0 F S I=$O(A(I)) Q:I'=+$P(I,"E") D
. D LD1($G(A(I)),$G(A(I,"F"),"!"))
;
E S I=0 F S I=$O(@G@(I)) Q:I'=+$P(I,"E") D
. D LD1($G(@G@(I),$G(@G@(I,0))),$G(@G@(I,"F"),"!"))
;
K:'N @T S:N @T=N
I DINAKED]"" S DINAKED=$S(DINAKED["""""":$O(@DINAKED),1:$D(@DINAKED))
Q
;
LD1(S,F) ;Load string S, with format F
;In: N and T
N C,J,L
S:S[$C(7) S=$TR(S,$C(7),"")
F J=1:1:$L(F,"!")-1 S N=N+1,^TMP(T,$J,N)=""
S:'N N=1
S:F["?" @("C="_+$P(F,"?",2))
S L=$G(^TMP(T,$J,N))
S ^TMP(T,$J,N)=L_$J("",$G(C)-$L(L))_S
Q
;
SM ;Print text in ScreenMan's Command Area
I $D(DDSID),$D(DTOUT)!$D(DUOUT) G SMQ
N DDIOL
S DDIOL=1
;
I $D(A)=1&($G(G)="")!($D(A)>9) D
. D MSG^DDSMSG(.A,"",$G(FMT))
E I $D(@G@(+$O(@G@(0)),0))#2 D
. D WP^DDSMSG(G)
E D HLP^DDSMSG(G)
;
SMQ I DINAKED]"" S DINAKED=$S(DINAKED["""""":$O(@DINAKED),1:$D(@DINAKED))
Q
DDIOL ;SFISC/MKO-THE LOADER ;7SEP2011
+1 ;;22.0;VA FileMan;**168**;Mar 30, 1999;Build 27
+2 ;Per VHA Directive 2004-038, this routine should not be modified.
+3 ;
EN(A,G,FMT) ;Write the text contained in local array A or global array G
+1 ;If one string passed, use format FMT
+2 NEW %,Y,DINAKED
+3 SET DINAKED=$$LGR^%ZOSV
+4 ;
+5 IF '$DATA(A)
SET A=""
+6 IF $GET(A)=""
IF $DATA(A)<9
IF $GET(FMT)=""
IF $GET(G)'?1"^"1A.7AN
IF $GET(G)'?1"^"1A.7AN1"(".E1")"
QUIT
+7 ;
+8 IF $DATA(DDS)
GOTO SM
+9 IF $DATA(DIQUIET)
GOTO LD
+10 ;
+11 NEW F,I,S
+12 IF $DATA(A)=1
IF $GET(G)=""
Begin DoDot:1
+13 SET F=$SELECT($GET(FMT)]"":FMT,1:"!")
+14 WRITE @F,A
End DoDot:1
+15 ;
+16 IF '$TEST
IF $DATA(A)>9
SET I=0
FOR
SET I=$ORDER(A(I))
IF I'=+$PIECE(I,"E")
QUIT
Begin DoDot:1
+17 SET F=$GET(A(I,"F"),"!")
IF F=""
SET F="?0"
+18 WRITE @F,$GET(A(I))
End DoDot:1
+19 ;
+20 IF '$TEST
SET I=0
FOR
SET I=$ORDER(@G@(I))
IF I'=+$PIECE(I,"E")
QUIT
Begin DoDot:1
+21 SET S=$GET(@G@(I,0),$GET(@G@(I)))
+22 SET F=$GET(@G@(I,"F"),"!")
IF F=""
SET F="?0"
+23 WRITE @F,S
End DoDot:1
+24 ;
+25 IF DINAKED]""
SET DINAKED=$SELECT(DINAKED["""""":$ORDER(@DINAKED),1:$DATA(@DINAKED))
+26 QUIT
+27 ;
LD ;Load text into ^TMP
+1 NEW I,N,T
+2 SET T=$SELECT($GET(DDIOLFLG)["H":"DIHELP",1:"DIMSG")
+3 SET N=$ORDER(^TMP(T,$JOB," "),-1)
+4 ;
+5 IF $DATA(A)=1
IF $GET(G)=""
Begin DoDot:1
+6 DO LD1(A,$SELECT($GET(FMT)]"":FMT,1:"!"))
End DoDot:1
+7 ;
+8 IF '$TEST
IF $DATA(A)>9
SET I=0
FOR
SET I=$ORDER(A(I))
IF I'=+$PIECE(I,"E")
QUIT
Begin DoDot:1
+9 DO LD1($GET(A(I)),$GET(A(I,"F"),"!"))
End DoDot:1
+10 ;
+11 IF '$TEST
SET I=0
FOR
SET I=$ORDER(@G@(I))
IF I'=+$PIECE(I,"E")
QUIT
Begin DoDot:1
+12 DO LD1($GET(@G@(I),$GET(@G@(I,0))),$GET(@G@(I,"F"),"!"))
End DoDot:1
+13 ;
+14 IF 'N
KILL @T
IF N
SET @T=N
+15 IF DINAKED]""
SET DINAKED=$SELECT(DINAKED["""""":$ORDER(@DINAKED),1:$DATA(@DINAKED))
+16 QUIT
+17 ;
LD1(S,F) ;Load string S, with format F
+1 ;In: N and T
+2 NEW C,J,L
+3 IF S[$CHAR(7)
SET S=$TRANSLATE(S,$CHAR(7),"")
+4 FOR J=1:1:$LENGTH(F,"!")-1
SET N=N+1
SET ^TMP(T,$JOB,N)=""
+5 IF 'N
SET N=1
+6 IF F["?"
SET @("C="_+$PIECE(F,"?",2))
+7 SET L=$GET(^TMP(T,$JOB,N))
+8 SET ^TMP(T,$JOB,N)=L_$JUSTIFY("",$GET(C)-$LENGTH(L))_S
+9 QUIT
+10 ;
SM ;Print text in ScreenMan's Command Area
+1 IF $DATA(DDSID)
IF $DATA(DTOUT)!$DATA(DUOUT)
GOTO SMQ
+2 NEW DDIOL
+3 SET DDIOL=1
+4 ;
+5 IF $DATA(A)=1&($GET(G)="")!($DATA(A)>9)
Begin DoDot:1
+6 DO MSG^DDSMSG(.A,"",$GET(FMT))
End DoDot:1
+7 IF '$TEST
IF $DATA(@G@(+$ORDER(@G@(0)),0))#2
Begin DoDot:1
+8 DO WP^DDSMSG(G)
End DoDot:1
+9 IF '$TEST
DO HLP^DDSMSG(G)
+10 ;
SMQ IF DINAKED]""
SET DINAKED=$SELECT(DINAKED["""""":$ORDER(@DINAKED),1:$DATA(@DINAKED))
+1 QUIT