OCXDI2 ;SLC/RJS,CLA - OCX PACKAGE DIAGNOSTIC UTILITY ROUTINE ;SEP 7,1999 at 10:30
;;3.0;ORDER ENTRY/RESULTS REPORTING;**32**;Dec 17,1997
;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
;
S ;
; Record Utilities
Q
;
ADDREC(OCXCREF) ;
;
;
N QUIT,OCXDD,OCXDA,OCXGREF,OCXNAME
S OCXDD=$O(@OCXCREF@("")) Q:'OCXDD 0
Q:'OCXFLGC 0
I (OCXFLGA) S QUIT=$$READ("Y"," Do you want to add a local '"_$$FILENAME^OCXBDTD(+OCXDD)_"' record ?","YES") Q:'QUIT (QUIT[U)
;
S OCXDA=0 D CREATE(OCXCREF,OCXDD,.OCXDA,0)
S OCXNAME=$G(@OCXCREF@(OCXDD,.01,"E")) S:$L(OCXNAME) ^TMP("OCXDIAG",$J,"A",+OCXDD,OCXNAME)=""
;
Q 0
;
DELREC(OCXFILE,OCXDA) ;
;
;
N QUIT
Q:'OCXFLGC 0 Q:$G(OCXAUTO) 0
I (OCXFLGA) S QUIT=$$READ("Y"," Do you want to delete the local '"_$$FILENAME^OCXBDTD(+OCXFILE)_"' record ?","YES") Q:'QUIT (QUIT[U)
;
W !,OCXFILE," ",OCXDA
D DIE(OCXFILE,$$FILE^OCXBDTD(OCXFILE,"GLOBAL NAME"),.01,"@",OCXDA,0)
W !!," deleted..."
;
Q 0
;
DELDUP(OCXFILE,OCXNAME) ;
;
;
N OCXQUIT,OCXCGL,OCXOGL,OCXD0,RESP,OCXKEY,KEYLEN,OCXKEEP
;
I (OCXFLGR) W !," There are duplicate copies of the '"_$$FILENAME^OCXBDTD(+OCXFILE)_":"_OCXNAME_"' record."
I '$G(OCXAUTO),'OCXFLGC Q 0
I (OCXFLGA) S RESP=$$READ("Y"," Do you want to purge duplicate copies of the '"_$$FILENAME^OCXBDTD(+OCXFILE)_":"_OCXNAME_"' record ?","YES") Q:'RESP 0 Q:(RESP[U) -10
;
S OCXOGL=$$FILE^OCXBDTD(OCXFILE,"GLOBAL NAME")
S OCXCGL=$$CREF^DILF(OCXOGL)
F KEYLEN=$L(OCXNAME):-1:1 S OCXKEY=$E(OCXNAME,1,KEYLEN) Q:$D(@OCXCGL@("B",OCXKEY))
S OCXD0=0 F S OCXD0=$O(@OCXCGL@("B",OCXKEY,OCXD0)) Q:'OCXD0 Q:($P($G(@OCXCGL@(OCXD0,0)),U,1)=OCXNAME)
W:OCXFLGR !,"Keep: ",OCXFILE," ",OCXNAME," ",OCXD0
S OCXKEEP=OCXD0 F S OCXD0=$O(@OCXCGL@("B",OCXKEY,OCXD0)) Q:'OCXD0 I ($P($G(@OCXCGL@(OCXD0,0)),U,1)=OCXNAME) D
.W:OCXFLGR !!,"Delete: ",OCXFILE," ",OCXNAME," ",OCXD0
.D DIE(OCXFILE,OCXOGL,.01,"@",OCXD0,0)
.W:OCXFLGR " deleted..."
;
I ($P($G(@OCXCGL@(OCXKEEP,0)),U,1)=OCXNAME) S ^TMP("OCXDIAG",$J,"A",FILE,OCXNAME)=""
;
Q OCXKEEP
;
CREATE(OCXCREF,OCXDD,OCXDA,OCXLVL) ;
;
N OCXFLD,OCXGREF,OCXKEY
;
S OCXKEY=@OCXCREF@(OCXDD,.01,"E")
S OCXGREF=$$GETREF(+OCXDD,.OCXDA,OCXLVL) Q:'$L(OCXGREF)
I 'OCXDA D
.S OCXDA=$O(^TMP("OCXDIAG",$J,"B",+OCXDD,OCXKEY,0)) Q:OCXDA
.S OCXDA=$O(@(OCXGREF_""" "")"),-1)+1
.F OCXDA=OCXDA:1 Q:'$D(@(OCXGREF_OCXDA_",0)"))
.I $D(@(OCXGREF_OCXDA_",0)")) S OCXDA=0
;
I 'OCXDA W !!,"Error adding record..." Q
;
I '$D(@(OCXGREF_"0)")) S @(OCXGREF_"0)")=U_$$FILEHDR^OCXBDTD(+OCXDD)_U_U
;
S OCXFLD=0 F S OCXFLD=$O(@OCXCREF@(OCXDD,OCXFLD)) Q:'OCXFLD Q:(OCXFLD[":") I '$$EXFLD^OCXDI1(+OCXDD,OCXFLD) D
.I $L($G(@OCXCREF@(OCXDD,OCXFLD,"E"))) D DIE(OCXDD,OCXGREF,OCXFLD,@OCXCREF@(OCXDD,OCXFLD,"E"),.OCXDA,OCXLVL)
.I $O(@OCXCREF@(OCXDD,OCXFLD,0)) D WORD(OCXDD,OCXGREF,OCXFLD,.OCXDA,OCXCREF)
;
D PUSH(.OCXDA)
S OCXFLD="" F S OCXFLD=$O(@OCXCREF@(OCXDD,OCXFLD)) Q:'$L(OCXFLD) I (OCXFLD[":") D
.S OCXDA=$P(OCXFLD,":",2) W:OCXFLGR ! D CREATE($$APPEND(OCXCREF,OCXDD),OCXFLD,.OCXDA,OCXLVL+1)
D POP(.OCXDA)
Q
;
LOADWORD(RREF,OCXDD,OCXFLD,OCXSUB) ;
;
N QUIT,DDPATH,INDEX,OCXDA,OCXGREF
S DDPATH=$P($P($$APPEND(RREF,OCXDD),"(",2),")",1)
F INDEX=1:1:$L(DDPATH,",") S OCXDA($L(DDPATH,",")-INDEX)=+$P($P(DDPATH,",",INDEX),":",2)
S OCXDA=$G(OCXDA(0)) K OCXDA(0)
Q:'OCXFLGC 0 I OCXFLGA S QUIT=$$READ("Y"," Do you want to reload the local '"_$$FIELD^OCXBDTD(+OCXDD,+OCXFLD,"LABEL")_"' field ?","YES") Q:'QUIT (QUIT[U)
S OCXGREF=$$GETREF(+OCXDD,.OCXDA,$L(DDPATH,",")-1) Q:'$L(OCXGREF)
D WORD(OCXDD,OCXGREF,OCXFLD,.OCXDA,RREF)
Q 0
;
GETREF(OCXDD,OCXDA,OCXLVL) ;
;
Q:'OCXDD ""
;
N OCXIENS,OCXERR,OCXX
S OCXIENS=$$IENS^DILF(.OCXDA),OCXERR=""
S OCXX=$$ROOT^DILFD(OCXDD,OCXIENS,0,OCXERR)
Q OCXX
;
WORD(DD,GREF,FLD,DA,RREF) ;
;
N SUB,GLROOT,LINE
S SUB=$P($$FIELD^OCXBDTD(+DD,FLD,"GLOBAL SUBSCRIPT LOCATION"),";",1) S:'(SUB=+SUB) SUB=""""_SUB_""""
S GLROOT=GREF_DA_","_SUB_")" K @GLROOT
S LINE=0 F S LINE=$O(@RREF@(DD,FLD,LINE)) Q:'LINE D
.S @GLROOT@($O(@GLROOT@(""),-1)+1,0)=@RREF@(DD,FLD,LINE)
S LINE=$O(@GLROOT@(""),-1),@GLROOT@(0)=U_U_LINE_U_LINE_U_$$DATE("T")_U
;
Q
;
DATE(X) N %DT,Y S %DT="" D ^%DT Q +Y
;
DIE(OCXDD,OCXDIC,OCXFLD,OCXVAL,OCXDA,OCXLVL) ;
;
N DIC,DIE,X,Y,DR,DA,OCXDVAL,OCXPTR,OCXGREF,D0
S (D0,DA)=OCXDA,(DIC,DIE)=OCXDIC,DR=""
S:OCXLVL D0=OCXDA(1),DR="S DA(1)="_(+D0)_",D0="_(+D0)_";"
S:OCXVAL="?" OCXVAL="? "
;
I '(OCXVAL="@"),OCXFLGR W !,?(OCXLVL*5),$$FIELD^OCXBDTD(+OCXDD,OCXFLD,"LABEL"),": ",OCXVAL
;
I '(OCXVAL="@") D
.N OCXIEN,SHORT
.S OCXPTR=+$P($$FIELD^OCXBDTD(+OCXDD,OCXFLD,"SPECIFIER"),"P",2)
.I 'OCXPTR S DR=DR_OCXFLD_"///^S X=OCXVAL" Q
.S OCXGREF="^"_$$FIELD^OCXBDTD(+OCXDD,OCXFLD,"POINTER")
.I '($E(OCXGREF,1,4)="^OCX"),'(OCXGREF="^ORD(100.9,"),'(OCXGREF="^ORD(100.8,") Q
.S OCXIEN=$$DIC(OCXGREF,OCXVAL,0)
.S:'OCXIEN OCXIEN=$$DIC(OCXGREF,OCXVAL,1),^TMP("OCXDIAG",$J,"B",OCXPTR,OCXVAL,OCXIEN)=""
.S DR=DR_OCXFLD_"///`"_(+OCXIEN)
;
I (OCXVAL="@") S DR=DR_OCXFLD_"///^S X=OCXVAL"
S OCXSCR=1
D ^DIE
;
; I $D(Y) -> DIE FILER ERROR
;
Q
;
DIC(DIC,X,OCXADD) S DIC(0)="MX",OCXSCR=1 S:OCXADD DIC(0)="MXL" D ^DIC Q:(+Y>0) +Y Q 0
;
PUSH(OCXDA) ;
N OCXSUB S OCXSUB="" F S OCXSUB=$O(OCXDA(OCXSUB),-1) Q:'OCXSUB S OCXDA(OCXSUB+1)=OCXDA(OCXSUB)
S OCXDA(1)=OCXDA,OCXDA=0
Q
;
POP(OCXDA) ;
N OCXSUB S OCXSUB="" F S OCXSUB=$O(OCXDA(OCXSUB)) Q:'OCXSUB S OCXDA(OCXSUB)=$G(OCXDA(OCXSUB+1))
S OCXDA=OCXDA(1) K OCXDA($O(OCXDA(""),-1))
Q
;
APPEND(ARRAY,OCXSUB) ;
S:'(OCXSUB=+OCXSUB) OCXSUB=""""_OCXSUB_""""
Q:'(ARRAY["(") ARRAY_"("_OCXSUB_")"
Q $E(ARRAY,1,$L(ARRAY)-1)_","_OCXSUB_")"
;
READ(OCXZ0,OCXZA,OCXZB,OCXZL) ;
N OCXLINE,DIR,DTOUT,DUOUT,DIRUT,DIROUT
Q:'$L($G(OCXZ0)) U
S DIR(0)=OCXZ0
S:$L($G(OCXZA)) DIR("A")=OCXZA
S:$L($G(OCXZB)) DIR("B")=OCXZB
F OCXLINE=1:1:($G(OCXZL)-1) W !
D ^DIR
I $D(DTOUT)!$D(DUOUT)!$D(DIRUT)!$D(DIROUT) Q U
Q Y
;
PAUSE() Q:'OCXFLGC 0 W " Press Enter " R X:DTIME W ! Q (X[U)
;
OCXDI2 ;SLC/RJS,CLA - OCX PACKAGE DIAGNOSTIC UTILITY ROUTINE ;SEP 7,1999 at 10:30
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**32**;Dec 17,1997
+2 ;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
+3 ;
S ;
+1 ; Record Utilities
+2 QUIT
+3 ;
ADDREC(OCXCREF) ;
+1 ;
+2 ;
+3 NEW QUIT,OCXDD,OCXDA,OCXGREF,OCXNAME
+4 SET OCXDD=$ORDER(@OCXCREF@(""))
IF 'OCXDD
QUIT 0
+5 IF 'OCXFLGC
QUIT 0
+6 IF (OCXFLGA)
SET QUIT=$$READ("Y"," Do you want to add a local '"_$$FILENAME^OCXBDTD(+OCXDD)_"' record ?","YES")
IF 'QUIT
QUIT (QUIT[U)
+7 ;
+8 SET OCXDA=0
DO CREATE(OCXCREF,OCXDD,.OCXDA,0)
+9 SET OCXNAME=$GET(@OCXCREF@(OCXDD,.01,"E"))
IF $LENGTH(OCXNAME)
SET ^TMP("OCXDIAG",$JOB,"A",+OCXDD,OCXNAME)=""
+10 ;
+11 QUIT 0
+12 ;
DELREC(OCXFILE,OCXDA) ;
+1 ;
+2 ;
+3 NEW QUIT
+4 IF 'OCXFLGC
QUIT 0
IF $GET(OCXAUTO)
QUIT 0
+5 IF (OCXFLGA)
SET QUIT=$$READ("Y"," Do you want to delete the local '"_$$FILENAME^OCXBDTD(+OCXFILE)_"' record ?","YES")
IF 'QUIT
QUIT (QUIT[U)
+6 ;
+7 WRITE !,OCXFILE," ",OCXDA
+8 DO DIE(OCXFILE,$$FILE^OCXBDTD(OCXFILE,"GLOBAL NAME"),.01,"@",OCXDA,0)
+9 WRITE !!," deleted..."
+10 ;
+11 QUIT 0
+12 ;
DELDUP(OCXFILE,OCXNAME) ;
+1 ;
+2 ;
+3 NEW OCXQUIT,OCXCGL,OCXOGL,OCXD0,RESP,OCXKEY,KEYLEN,OCXKEEP
+4 ;
+5 IF (OCXFLGR)
WRITE !," There are duplicate copies of the '"_$$FILENAME^OCXBDTD(+OCXFILE)_":"_OCXNAME_"' record."
+6 IF '$GET(OCXAUTO)
IF 'OCXFLGC
QUIT 0
+7 IF (OCXFLGA)
SET RESP=$$READ("Y"," Do you want to purge duplicate copies of the '"_$$FILENAME^OCXBDTD(+OCXFILE)_":"_OCXNAME_"' record ?","YES")
IF 'RESP
QUIT 0
IF (RESP[U)
QUIT -10
+8 ;
+9 SET OCXOGL=$$FILE^OCXBDTD(OCXFILE,"GLOBAL NAME")
+10 SET OCXCGL=$$CREF^DILF(OCXOGL)
+11 FOR KEYLEN=$LENGTH(OCXNAME):-1:1
SET OCXKEY=$EXTRACT(OCXNAME,1,KEYLEN)
IF $DATA(@OCXCGL@("B",OCXKEY))
QUIT
+12 SET OCXD0=0
FOR
SET OCXD0=$ORDER(@OCXCGL@("B",OCXKEY,OCXD0))
IF 'OCXD0
QUIT
IF ($PIECE($GET(@OCXCGL@(OCXD0,0)),U,1)=OCXNAME)
QUIT
+13 IF OCXFLGR
WRITE !,"Keep: ",OCXFILE," ",OCXNAME," ",OCXD0
+14 SET OCXKEEP=OCXD0
FOR
SET OCXD0=$ORDER(@OCXCGL@("B",OCXKEY,OCXD0))
IF 'OCXD0
QUIT
IF ($PIECE($GET(@OCXCGL@(OCXD0,0)),U,1)=OCXNAME)
Begin DoDot:1
+15 IF OCXFLGR
WRITE !!,"Delete: ",OCXFILE," ",OCXNAME," ",OCXD0
+16 DO DIE(OCXFILE,OCXOGL,.01,"@",OCXD0,0)
+17 IF OCXFLGR
WRITE " deleted..."
End DoDot:1
+18 ;
+19 IF ($PIECE($GET(@OCXCGL@(OCXKEEP,0)),U,1)=OCXNAME)
SET ^TMP("OCXDIAG",$JOB,"A",FILE,OCXNAME)=""
+20 ;
+21 QUIT OCXKEEP
+22 ;
CREATE(OCXCREF,OCXDD,OCXDA,OCXLVL) ;
+1 ;
+2 NEW OCXFLD,OCXGREF,OCXKEY
+3 ;
+4 SET OCXKEY=@OCXCREF@(OCXDD,.01,"E")
+5 SET OCXGREF=$$GETREF(+OCXDD,.OCXDA,OCXLVL)
IF '$LENGTH(OCXGREF)
QUIT
+6 IF 'OCXDA
Begin DoDot:1
+7 SET OCXDA=$ORDER(^TMP("OCXDIAG",$JOB,"B",+OCXDD,OCXKEY,0))
IF OCXDA
QUIT
+8 SET OCXDA=$ORDER(@(OCXGREF_""" "")"),-1)+1
+9 FOR OCXDA=OCXDA:1
IF '$DATA(@(OCXGREF_OCXDA_",0)"))
QUIT
+10 IF $DATA(@(OCXGREF_OCXDA_",0)"))
SET OCXDA=0
End DoDot:1
+11 ;
+12 IF 'OCXDA
WRITE !!,"Error adding record..."
QUIT
+13 ;
+14 IF '$DATA(@(OCXGREF_"0)"))
SET @(OCXGREF_"0)")=U_$$FILEHDR^OCXBDTD(+OCXDD)_U_U
+15 ;
+16 SET OCXFLD=0
FOR
SET OCXFLD=$ORDER(@OCXCREF@(OCXDD,OCXFLD))
IF 'OCXFLD
QUIT
IF (OCXFLD["
QUIT
IF '$$EXFLD^OCXDI1(+OCXDD,OCXFLD)
Begin DoDot:1
+17 IF $LENGTH($GET(@OCXCREF@(OCXDD,OCXFLD,"E")))
DO DIE(OCXDD,OCXGREF,OCXFLD,@OCXCREF@(OCXDD,OCXFLD,"E"),.OCXDA,OCXLVL)
+18 IF $ORDER(@OCXCREF@(OCXDD,OCXFLD,0))
DO WORD(OCXDD,OCXGREF,OCXFLD,.OCXDA,OCXCREF)
End DoDot:1
+19 ;
+20 DO PUSH(.OCXDA)
+21 SET OCXFLD=""
FOR
SET OCXFLD=$ORDER(@OCXCREF@(OCXDD,OCXFLD))
IF '$LENGTH(OCXFLD)
QUIT
IF (OCXFLD[":")
Begin DoDot:1
+22 SET OCXDA=$PIECE(OCXFLD,":",2)
IF OCXFLGR
WRITE !
DO CREATE($$APPEND(OCXCREF,OCXDD),OCXFLD,.OCXDA,OCXLVL+1)
End DoDot:1
+23 DO POP(.OCXDA)
+24 QUIT
+25 ;
LOADWORD(RREF,OCXDD,OCXFLD,OCXSUB) ;
+1 ;
+2 NEW QUIT,DDPATH,INDEX,OCXDA,OCXGREF
+3 SET DDPATH=$PIECE($PIECE($$APPEND(RREF,OCXDD),"(",2),")",1)
+4 FOR INDEX=1:1:$LENGTH(DDPATH,",")
SET OCXDA($LENGTH(DDPATH,",")-INDEX)=+$PIECE($PIECE(DDPATH,",",INDEX),":",2)
+5 SET OCXDA=$GET(OCXDA(0))
KILL OCXDA(0)
+6 IF 'OCXFLGC
QUIT 0
IF OCXFLGA
SET QUIT=$$READ("Y"," Do you want to reload the local '"_$$FIELD^OCXBDTD(+OCXDD,+OCXFLD,"LABEL")_"' field ?","YES")
IF 'QUIT
QUIT (QUIT[U)
+7 SET OCXGREF=$$GETREF(+OCXDD,.OCXDA,$LENGTH(DDPATH,",")-1)
IF '$LENGTH(OCXGREF)
QUIT
+8 DO WORD(OCXDD,OCXGREF,OCXFLD,.OCXDA,RREF)
+9 QUIT 0
+10 ;
GETREF(OCXDD,OCXDA,OCXLVL) ;
+1 ;
+2 IF 'OCXDD
QUIT ""
+3 ;
+4 NEW OCXIENS,OCXERR,OCXX
+5 SET OCXIENS=$$IENS^DILF(.OCXDA)
SET OCXERR=""
+6 SET OCXX=$$ROOT^DILFD(OCXDD,OCXIENS,0,OCXERR)
+7 QUIT OCXX
+8 ;
WORD(DD,GREF,FLD,DA,RREF) ;
+1 ;
+2 NEW SUB,GLROOT,LINE
+3 SET SUB=$PIECE($$FIELD^OCXBDTD(+DD,FLD,"GLOBAL SUBSCRIPT LOCATION"),";",1)
IF '(SUB=+SUB)
SET SUB=""""_SUB_""""
+4 SET GLROOT=GREF_DA_","_SUB_")"
KILL @GLROOT
+5 SET LINE=0
FOR
SET LINE=$ORDER(@RREF@(DD,FLD,LINE))
IF 'LINE
QUIT
Begin DoDot:1
+6 SET @GLROOT@($ORDER(@GLROOT@(""),-1)+1,0)=@RREF@(DD,FLD,LINE)
End DoDot:1
+7 SET LINE=$ORDER(@GLROOT@(""),-1)
SET @GLROOT@(0)=U_U_LINE_U_LINE_U_$$DATE("T")_U
+8 ;
+9 QUIT
+10 ;
DATE(X) NEW %DT,Y
SET %DT=""
DO ^%DT
QUIT +Y
+1 ;
DIE(OCXDD,OCXDIC,OCXFLD,OCXVAL,OCXDA,OCXLVL) ;
+1 ;
+2 NEW DIC,DIE,X,Y,DR,DA,OCXDVAL,OCXPTR,OCXGREF,D0
+3 SET (D0,DA)=OCXDA
SET (DIC,DIE)=OCXDIC
SET DR=""
+4 IF OCXLVL
SET D0=OCXDA(1)
SET DR="S DA(1)="_(+D0)_",D0="_(+D0)_";"
+5 IF OCXVAL="?"
SET OCXVAL="? "
+6 ;
+7 IF '(OCXVAL="@")
IF OCXFLGR
WRITE !,?(OCXLVL*5),$$FIELD^OCXBDTD(+OCXDD,OCXFLD,"LABEL"),": ",OCXVAL
+8 ;
+9 IF '(OCXVAL="@")
Begin DoDot:1
+10 NEW OCXIEN,SHORT
+11 SET OCXPTR=+$PIECE($$FIELD^OCXBDTD(+OCXDD,OCXFLD,"SPECIFIER"),"P",2)
+12 IF 'OCXPTR
SET DR=DR_OCXFLD_"///^S X=OCXVAL"
QUIT
+13 SET OCXGREF="^"_$$FIELD^OCXBDTD(+OCXDD,OCXFLD,"POINTER")
+14 IF '($EXTRACT(OCXGREF,1,4)="^OCX")
IF '(OCXGREF="^ORD(100.9,")
IF '(OCXGREF="^ORD(100.8,")
QUIT
+15 SET OCXIEN=$$DIC(OCXGREF,OCXVAL,0)
+16 IF 'OCXIEN
SET OCXIEN=$$DIC(OCXGREF,OCXVAL,1)
SET ^TMP("OCXDIAG",$JOB,"B",OCXPTR,OCXVAL,OCXIEN)=""
+17 SET DR=DR_OCXFLD_"///`"_(+OCXIEN)
End DoDot:1
+18 ;
+19 IF (OCXVAL="@")
SET DR=DR_OCXFLD_"///^S X=OCXVAL"
+20 SET OCXSCR=1
+21 DO ^DIE
+22 ;
+23 ; I $D(Y) -> DIE FILER ERROR
+24 ;
+25 QUIT
+26 ;
DIC(DIC,X,OCXADD) SET DIC(0)="MX"
SET OCXSCR=1
IF OCXADD
SET DIC(0)="MXL"
DO ^DIC
IF (+Y>0)
QUIT +Y
QUIT 0
+1 ;
PUSH(OCXDA) ;
+1 NEW OCXSUB
SET OCXSUB=""
FOR
SET OCXSUB=$ORDER(OCXDA(OCXSUB),-1)
IF 'OCXSUB
QUIT
SET OCXDA(OCXSUB+1)=OCXDA(OCXSUB)
+2 SET OCXDA(1)=OCXDA
SET OCXDA=0
+3 QUIT
+4 ;
POP(OCXDA) ;
+1 NEW OCXSUB
SET OCXSUB=""
FOR
SET OCXSUB=$ORDER(OCXDA(OCXSUB))
IF 'OCXSUB
QUIT
SET OCXDA(OCXSUB)=$GET(OCXDA(OCXSUB+1))
+2 SET OCXDA=OCXDA(1)
KILL OCXDA($ORDER(OCXDA(""),-1))
+3 QUIT
+4 ;
APPEND(ARRAY,OCXSUB) ;
+1 IF '(OCXSUB=+OCXSUB)
SET OCXSUB=""""_OCXSUB_""""
+2 IF '(ARRAY["(")
QUIT ARRAY_"("_OCXSUB_")"
+3 QUIT $EXTRACT(ARRAY,1,$LENGTH(ARRAY)-1)_","_OCXSUB_")"
+4 ;
READ(OCXZ0,OCXZA,OCXZB,OCXZL) ;
+1 NEW OCXLINE,DIR,DTOUT,DUOUT,DIRUT,DIROUT
+2 IF '$LENGTH($GET(OCXZ0))
QUIT U
+3 SET DIR(0)=OCXZ0
+4 IF $LENGTH($GET(OCXZA))
SET DIR("A")=OCXZA
+5 IF $LENGTH($GET(OCXZB))
SET DIR("B")=OCXZB
+6 FOR OCXLINE=1:1:($GET(OCXZL)-1)
WRITE !
+7 DO ^DIR
+8 IF $DATA(DTOUT)!$DATA(DUOUT)!$DATA(DIRUT)!$DATA(DIROUT)
QUIT U
+9 QUIT Y
+10 ;
PAUSE() IF 'OCXFLGC
QUIT 0
WRITE " Press Enter "
READ X:DTIME
WRITE !
QUIT (X[U)
+1 ;