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

XINDX51.m

Go to the documentation of this file.
  1. XINDX51 ;ISC/REL,GRK,RWF - PRINT ROUTINE ;06/24/08 16:06
  1. ;;7.3;TOOLKIT;**20,48,61,110,133,140,149,151**;Apr 25, 1995;Build 1
  1. ; Per VHA Directive 2004-038, this routine should not be modified.
  1. ;Setup Local IO paramiters
  1. B S RTN="",INL(1)=IOM-2,INL(2)=IOSL-4,INL(3)=("C"=$E(IOST)),INL(4)=IOM-1,PG=0,INL(5)="Compiled list of Errors and Warnings "
  1. K ER,HED D HD1 ;Do header
  1. ;Show Errors
  1. F S RTN=$O(^UTILITY($J,1,RTN)) Q:RTN=""!$D(IND("QUIT")) S X=^(RTN,0) I $D(^UTILITY($J,1,RTN,"E"))>9 S HED=$$BHDR(RTN,X) D HD,WERR(1)
  1. W:'$D(ER) !,"No errors or warnings to report",!
  1. ;Did they want more?
  1. G END:'INP(1)!$D(IND("QUIT")),CR:INP(6)
  1. ;Show detail on each routine
  1. W !!,"--- Routine Detail"
  1. W:INP(5)?1A " --- with "_$S(INP(5)["R":"REGULAR",INP(5)["S":"STRUCTURED",INP(5)["B":"R/S",1:"")_" ROUTINE LISTING" W " ---"
  1. S RTN="$",INDB="R" ;Report on each routine
  1. BL F S RTN=$O(^UTILITY($J,RTN)) Q:RTN=""!('INP(4)&(RTN?1"|"1.4L.NP))!$D(IND("QUIT")) D B1,CHK
  1. ;Exit or do Cross-Refference
  1. G END:NRO<2,END:$D(IND("QUIT")),CR
  1. ;
  1. BHDR(R,X) ;Build hdr
  1. Q $E(R_" ",1,15)_" * * "_$P(X,"^",2)_" Lines, "_(+X)_" Bytes, Checksum: "_$G(^UTILITY($J,1,R,"RSUM"))
  1. ;
  1. WERR(FL) ;Write error messages
  1. N ER2
  1. F ER=1:1 Q:'$D(^UTILITY($J,1,RTN,"E",ER))!$D(IND("QUIT")) S %=^(ER) D
  1. . I $Y'<INL(2) D HD K ER2
  1. . D:FL&(%>0)&($G(ER2)'=+%) WORL(^UTILITY($J,1,RTN,0,+%,0)) ;Write the routine line
  1. . W !?3,$P(%,$C(9),2) W:$X>16 ! W ?16,$P(%,$C(9),3) S ER2=+% ;Write the error p110
  1. . Q
  1. Q
  1. ;
  1. WR ;Write one routine
  1. S X=^UTILITY($J,1,RTN,0),INL(5)=$$BHDR(RTN,X)
  1. D HD1 W !,?14,$P(X,"^",3)_" bytes in comments" G:'INP(2) B2
  1. I $G(ROU),'$$WP^DIUTL($NA(^DIZ(1009.1,ROU,1)),12,IOM) S IND("QUIT")=1 ; GFT: Print Tammy's Documentation File
  1. F I=1:1 Q:'$D(^UTILITY($J,1,RTN,0,I)) S X=^(I,0) D
  1. . D:$Y'<INL(2) HD1 I $D(IND("QUIT")) S I=99999 Q
  1. . D WORL(X) ;Write routine line
  1. . Q
  1. Q
  1. ;
  1. WORL(D) ;Write one routine line
  1. N J,L
  1. I $G(ROU) S J=$P($P(D," "),"(") S:J]"" TAG=J S:J="" TAG=$P(TAG,"+")_"+"_($P(TAG,"+",2)+1) ; GFT: Print Tammy's Documentation File
  1. S L=$P(D," ",1),D=$P(D," ",2,999)
  1. F J=8,9:0 W !,L,?J," " W:$X>10 "--",!,?10 W $E(D,1,INL(4)-J) S D=$E(D,INL(4)-J+1,999),L="" Q:D=""
  1. I $G(ROU),TAG]"" S L=$O(^DIZ(1009.1,ROU,2,"B",TAG,0)) I L,'$$WP^DIUTL($NA(^DIZ(1009.1,ROU,2,L,1)),12,IOM) S IND("QUIT")=1 ; GFT ditto
  1. Q
  1. ;
  1. CHK I $D(ZTQUEUED),$$S^%ZTLOAD S IND("QUIT")=1,ZTSTOP=1
  1. S:$D(IND("QUIT")) RTN="~"
  1. Q
  1. ;
  1. B1 I '$D(^UTILITY($J,1,RTN,0)) Q ;No data to show
  1. N ROU,TAG S ROU=$O(^DIZ(1009.1,"B",RTN,0)),TAG=RTN ; GFT Tammy Docs
  1. S:INP(5)["N" OPT("NUM")=1
  1. D:INP(5)["S"!(INP(5)["B") ^XINDX8 ;Show structured listing
  1. D:INP(5)["F" SC
  1. D:INP(5)["R"!(INP(5)["B") WR ;Show normal listing
  1. B2 ;
  1. G:'INP(3)!('$D(^UTILITY($J,1,RTN,"E",0))) B3
  1. S HED="***** ERRORS & WARNINGS IN "_RTN_" *****" W !,HED
  1. D WERR(0) ;Show errors
  1. B3 ;
  1. S INL(5)="***** INDEX OF "_RTN_" *****" W !!,INL(5),!
  1. S HED="Local Variables Line Occurrences ( >> not killed explicitly)",HED(1)=$J("",40)_"( * Changed ! Killed ~ Newed)" D P("L","") Q:$D(IND("QUIT"))
  1. S HED="Global Variables ( * Changed ! Killed)" D P("G","") Q:$D(IND("QUIT"))
  1. S HED="Naked Globals" D P("N","") Q:$D(IND("QUIT"))
  1. S HED="Cache Objects" D P("O","") Q:$D(IND("QUIT"))
  1. S HED="Marked Items" D P("MK","") Q:$D(IND("QUIT"))
  1. S HED="Label References" D P("I","") Q:$D(IND("QUIT"))
  1. S HED="External References" D P("X","^") Q:$D(IND("QUIT"))
  1. W !!,"***** END *****",!
  1. Q
  1. ;
  1. P(LOC,SYM) ;
  1. S L="",PC="",TAB=$S("XG"[LOC:23,"O"[LOC:35,1:16) D HD Q:$D(IND("QUIT"))
  1. P1 S L=$O(^UTILITY($J,1,RTN,LOC,L)) G:L="" PX
  1. I LOC="X",L?1L.LNP Q
  1. ;p151 check for Kernel variables only if "L"ocal
  1. S X=$S($G(^UTILITY($J,1,RTN,LOC,L))]"":^(L),$G(^UTILITY($J,1,RTN,LOC,$P(L,"(")))]"":^($P(L,"(")),1:"")
  1. I LOC="L" S PC(1)=X_$S("^DT^DTIME^DILOCKTM^DUZ^IO^IOF^ION^IOM^IOSL^IOST^U^"[("^"_L_"^"):"!",1:" ")
  1. E S PC(1)=X_" "
  1. ;S PC(1)=$G(^UTILITY($J,1,RTN,LOC,$P(L,"(")))_$S("^DT^DTIME^DILOCKTM^DUZ^IO^IOF^ION^IOM^IOSL^IOST^U^"[("^"_$P(L,"(")_"^"):"!",1:" ") ;p149 added DILOCKTM
  1. S PC(1)=(PC(1)["!")!(PC(1)["~"),PC="*"
  1. F J=0:1 S X=$S($D(^UTILITY($J,1,RTN,LOC,L,J)):^(J),1:"") Q:X=""!$D(IND("QUIT")) D P2,P3
  1. G P1
  1. PX W:PC="" !?3,"NONE" K HED
  1. Q
  1. P2 I $Y'<INL(2) D HD S PC="*"
  1. Q:PC=L
  1. I LOC="L" W !,$S(('PC(1)):">> ",1:" "),SYM,L," ",?TAB Q
  1. I LOC'="X" W !," ",SYM,L,?TAB Q
  1. W !?3,$P(L," ",2),SYM,$P(L," ",1)," ",?TAB
  1. Q
  1. P3 W:$X>TAB !,?TAB
  1. S PC=L F I=1:1 S ARG=$P(X,",",I) Q:ARG="" W:$X+$L(ARG)>INL(1) !?TAB W:$X'=TAB "," W ARG
  1. I $G(ROU),LOC="L" S I=$O(^DIZ(1009.1,ROU,3,"B",L,0)) I I,'$$WP^DIUTL($NA(^DIZ(1009.1,ROU,3,I,1)),14,IOM) S IND("QUIT")=1 ; GFT Tammy Docs
  1. Q
  1. HD D:$Y'<INL(2) HD1 D HD2
  1. Q
  1. HD1 D WAIT:INL(3) S PG=PG+1 W @IOF,!,INL(5) W:(IOM-30)<$X ! W ?(IOM-30),INDXDT," page ",PG
  1. Q
  1. HD2 W !!,HED W:$D(HED(1)) !,HED(1)
  1. Q
  1. CR S INDB="C" U IO(0) W !!,"--- CROSS-REFERENCING ALL ROUTINES ---" U IO
  1. S RTN="$" D CRX^XINDX5
  1. S INL(5)="***** Cross Reference of all Routines *****",RTN="***" D HD1
  1. S HED="Local Variables Routines ( >> not killed explicitly)",HED(1)=$J("",30)_"( * Changed ! Killed ~ Newed)" D P("L","") G:$D(IND("QUIT")) END
  1. S HED="Global Variables" D P("G","") G:$D(IND("QUIT")) END
  1. S HED="Naked Globals" D P("N","") Q:$D(IND("QUIT"))
  1. S HED="Cache Objects" D P("O","") Q:$D(IND("QUIT"))
  1. S HED="Marked Items" D P("MK","") G:$D(IND("QUIT")) END
  1. S HED="Routine Invokes:" D P("Z","") G:$D(IND("QUIT")) END
  1. S HED="Routine is Invoked by:" D P("X","^")
  1. W !!,"***** END *****",!
  1. END K INL,HED Q
  1. SC ;Print a command chart
  1. S INL(5)=RTN_" Command chart" D HD1
  1. F I=0:0 S I=$O(^UTILITY($J,1,RTN,"COM",I)) Q:I'>0 W !,^(I)
  1. Q
  1. WAIT N % W !," Press return to continue:" R %:300 S:'$T %="^"
  1. I %["?" W !,"Press return to continue the report, ^ to exit the report" G WAIT
  1. S:%="^" IND("QUIT")=1 Q