ORY2693 ;SLC/RJS,CLA - OCX PACKAGE RULE TRANSPORT ROUTINE (Delete after Install of OR*3*269) ;JUL 26,2013 at 06:56
;;3.0;ORDER ENTRY/RESULTS REPORTING;**269**;Dec 17,1997;Build 85
;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
;
S ;
; Multiple Utilities
Q
;
ADDMULT(OCXCREF,OCXDD,OCXFLD) ;
;
;
N QUIT,OCXDA,OCXGREF,OCXNAME,DDPATH,INDEX
;
S DDPATH=$P($P($$APPEND($$APPEND(OCXCREF,OCXDD),OCXFLD),"(",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:(OCXFLAG["D") 0
I (OCXFLAG["A") S QUIT=$$READ("Y"," Do you want to add a local '"_$$FILENAME^OCXSENDD(+OCXFLD)_"' multiple ?","YES") Q:'QUIT (QUIT[U)
;
S OCXGREF=$$GETREF^ORY2692(+OCXFLD,.OCXDA,1)
D CREATE($$APPEND(OCXCREF,OCXDD),OCXFLD,.OCXDA,1)
;
Q 0
;
DELMULT(OCXCREF,OCXDD) ;
;
N QUIT,OCXGREF,DA,INDEX,DDPATH
;
Q:(OCXFLAG["D") 0
I (OCXFLAG["A") S QUIT=$$READ("Y"," Do you want to delete the local '"_$$FILENAME^OCXSENDD(+OCXDD)_"' multiple ?","YES") Q:'QUIT (QUIT[U)
;
S DDPATH=$P($P($$APPEND(OCXCREF,OCXDD),"(",2),")",1)
F INDEX=1:1:$L(DDPATH,",") S DA($L(DDPATH,",")-INDEX)=+$P($P(DDPATH,",",INDEX),":",2)
S DA=$G(DA(0)) K DA(0)
S OCXGREF=$$GETREF^ORY2692(+OCXDD,.DA,1)
;
D DIE^ORY2692(+OCXDD,OCXGREF,.01,"@",.DA,$L(DDPATH,",")-1)
K @OCXCREF@(OCXDD) W !!," deleted..."
;
Q 0
;
CREATE(OCXCREF,OCXDD,OCXDA,OCXLVL) ;
;
N OCXFLD,OCXGREF
;
S OCXGREF=$$GETREF^ORY2692(+OCXDD,.OCXDA,OCXLVL) Q:'$L(OCXGREF) S:'OCXDA OCXDA=$O(@(OCXGREF_"""@"")"),-1)+1
;
I '$D(@(OCXGREF_"0)")) S @(OCXGREF_"0)")=U_$$FILEHDR^OCXSENDD(+OCXDD)_U_U
;
S OCXFLD=0 F S OCXFLD=$O(@OCXCREF@(OCXDD,OCXFLD)) Q:'OCXFLD Q:(OCXFLD[":") I '$$EXFLD^ORY2691(+OCXDD,OCXFLD) D
.I $L($G(@OCXCREF@(OCXDD,OCXFLD,"E"))) D DIE^ORY2692(OCXDD,OCXGREF,OCXFLD,@OCXCREF@(OCXDD,OCXFLD,"E"),.OCXDA,OCXLVL)
;
D PUSH(.OCXDA)
S OCXFLD="" F S OCXFLD=$O(@OCXCREF@(OCXDD,OCXFLD)) Q:'$L(OCXFLD) I (OCXFLD[":") D
.S OCXDA=$P(OCXFLD,":",2) W ! D CREATE($$APPEND(OCXCREF,OCXDD),OCXFLD,.OCXDA,OCXLVL+1)
D POP(.OCXDA)
Q
;
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() W " Press Enter " R X:DTIME W ! Q (X[U)
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HORY2693 2930 printed Dec 13, 2024@02:40:22 Page 2
ORY2693 ;SLC/RJS,CLA - OCX PACKAGE RULE TRANSPORT ROUTINE (Delete after Install of OR*3*269) ;JUL 26,2013 at 06:56
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**269**;Dec 17,1997;Build 85
+2 ;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
+3 ;
S ;
+1 ; Multiple Utilities
+2 QUIT
+3 ;
ADDMULT(OCXCREF,OCXDD,OCXFLD) ;
+1 ;
+2 ;
+3 NEW QUIT,OCXDA,OCXGREF,OCXNAME,DDPATH,INDEX
+4 ;
+5 SET DDPATH=$PIECE($PIECE($$APPEND($$APPEND(OCXCREF,OCXDD),OCXFLD),"(",2),")",1)
+6 FOR INDEX=1:1:$LENGTH(DDPATH,",")
SET OCXDA($LENGTH(DDPATH,",")-INDEX)=+$PIECE($PIECE(DDPATH,",",INDEX),":",2)
+7 SET OCXDA=$GET(OCXDA(0))
KILL OCXDA(0)
+8 ;
+9 if (OCXFLAG["D")
QUIT 0
+10 IF (OCXFLAG["A")
SET QUIT=$$READ("Y"," Do you want to add a local '"_$$FILENAME^OCXSENDD(+OCXFLD)_"' multiple ?","YES")
if 'QUIT
QUIT (QUIT[U)
+11 ;
+12 SET OCXGREF=$$GETREF^ORY2692(+OCXFLD,.OCXDA,1)
+13 DO CREATE($$APPEND(OCXCREF,OCXDD),OCXFLD,.OCXDA,1)
+14 ;
+15 QUIT 0
+16 ;
DELMULT(OCXCREF,OCXDD) ;
+1 ;
+2 NEW QUIT,OCXGREF,DA,INDEX,DDPATH
+3 ;
+4 if (OCXFLAG["D")
QUIT 0
+5 IF (OCXFLAG["A")
SET QUIT=$$READ("Y"," Do you want to delete the local '"_$$FILENAME^OCXSENDD(+OCXDD)_"' multiple ?","YES")
if 'QUIT
QUIT (QUIT[U)
+6 ;
+7 SET DDPATH=$PIECE($PIECE($$APPEND(OCXCREF,OCXDD),"(",2),")",1)
+8 FOR INDEX=1:1:$LENGTH(DDPATH,",")
SET DA($LENGTH(DDPATH,",")-INDEX)=+$PIECE($PIECE(DDPATH,",",INDEX),":",2)
+9 SET DA=$GET(DA(0))
KILL DA(0)
+10 SET OCXGREF=$$GETREF^ORY2692(+OCXDD,.DA,1)
+11 ;
+12 DO DIE^ORY2692(+OCXDD,OCXGREF,.01,"@",.DA,$LENGTH(DDPATH,",")-1)
+13 KILL @OCXCREF@(OCXDD)
WRITE !!," deleted..."
+14 ;
+15 QUIT 0
+16 ;
CREATE(OCXCREF,OCXDD,OCXDA,OCXLVL) ;
+1 ;
+2 NEW OCXFLD,OCXGREF
+3 ;
+4 SET OCXGREF=$$GETREF^ORY2692(+OCXDD,.OCXDA,OCXLVL)
if '$LENGTH(OCXGREF)
QUIT
if 'OCXDA
SET OCXDA=$ORDER(@(OCXGREF_"""@"")"),-1)+1
+5 ;
+6 IF '$DATA(@(OCXGREF_"0)"))
SET @(OCXGREF_"0)")=U_$$FILEHDR^OCXSENDD(+OCXDD)_U_U
+7 ;
+8 SET OCXFLD=0
FOR
SET OCXFLD=$ORDER(@OCXCREF@(OCXDD,OCXFLD))
if 'OCXFLD
QUIT
if (OCXFLD["
QUIT
IF '$$EXFLD^ORY2691(+OCXDD,OCXFLD)
Begin DoDot:1
+9 IF $LENGTH($GET(@OCXCREF@(OCXDD,OCXFLD,"E")))
DO DIE^ORY2692(OCXDD,OCXGREF,OCXFLD,@OCXCREF@(OCXDD,OCXFLD,"E"),.OCXDA,OCXLVL)
End DoDot:1
+10 ;
+11 DO PUSH(.OCXDA)
+12 SET OCXFLD=""
FOR
SET OCXFLD=$ORDER(@OCXCREF@(OCXDD,OCXFLD))
if '$LENGTH(OCXFLD)
QUIT
IF (OCXFLD[":")
Begin DoDot:1
+13 SET OCXDA=$PIECE(OCXFLD,":",2)
WRITE !
DO CREATE($$APPEND(OCXCREF,OCXDD),OCXFLD,.OCXDA,OCXLVL+1)
End DoDot:1
+14 DO POP(.OCXDA)
+15 QUIT
+16 ;
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() WRITE " Press Enter "
READ X:DTIME
WRITE !
QUIT (X[U)
+1 ;