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

OCXOCMP8.m

Go to the documentation of this file.
  1. OCXOCMP8 ;SLC/RJS,CLA - ORDER CHECK CODE COMPILER (Assemble Order Check Routines utilities) ;10/29/98 12:37
  1. ;;3.0;ORDER ENTRY/RESULTS REPORTING;**32,243**;Dec 17,1997;Build 242
  1. ;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
  1. ;
  1. Q
  1. FILE(RNUM) ;
  1. ;
  1. W:'$G(OCXAUTO) !,$$RNAM(RNUM)
  1. N DIE,XCN,X
  1. S DIE="^TMP(""OCXCMP"",$J,""D CODE"","_RNUM_",",XCN=0,X=$$RNAM(RNUM)
  1. X ^%ZOSF("SAVE")
  1. Q
  1. ;
  1. APPEND(DSUB,CSUB,SRC,LABEL) ;
  1. ;
  1. N OCXSRC,OCXNDX,OCXNEXT,GLD,GLC
  1. S GLD="^TMP(""OCXCMP"",$J,""D CODE"","_(+DSUB)_")"
  1. I (CSUB="$") D Q
  1. .S OCXNEXT=$O(@GLD@(" "),-1)+1
  1. .S @GLD@(OCXNEXT,0)="$"
  1. .S OCXNEXT=$O(@GLD@(" "),-1)+1
  1. .S @GLD@(OCXNEXT,0)=""
  1. ;
  1. I (SRC="C") M GLC=^TMP("OCXCMP",$J,"C CODE",+CSUB) S ^TMP("OCXCMP",$J,"D CODE","LINE",LABEL)=DSUB_","_($O(@GLD@(" "),-1)+1)
  1. I (SRC="F") M GLC=^TMP("OCXCMP",$J,"INCLUDE",CSUB)
  1. S OCXNDX=0 F S OCXNDX=$O(GLC(OCXNDX)) Q:'OCXNDX D
  1. .S OCXNEXT=$O(@GLD@(" "),-1)+1
  1. .S @GLD@(OCXNEXT,0)=GLC(OCXNDX,0)
  1. M @GLD@("CALLS")=GLC("CALLS")
  1. S @GLD@("SIZE")=$G(@GLD@("SIZE"))+$G(GLC("SIZE"))
  1. Q
  1. ;
  1. SIZE(DSUB,CSUB) ;
  1. ;
  1. N D0,EFC,OCXEFC,OCXEFD,OCXEFF,OCXREC
  1. N OCXTEMP,PIEC,SIZEC,SIZED,SIZEF,TEXT
  1. ;
  1. S (SIZEC,SIZED,SIZEF)=0
  1. K OCXEFF,OCXEFC,OCXEFD
  1. S (OCXEFF,OCXEFC,OCXEFD)=""
  1. ;
  1. I $G(CSUB),$D(^TMP("OCXCMP",$J,"C CODE",+CSUB)) D
  1. .I $D(^TMP("OCXCMP",$J,"C CODE",+CSUB,"SIZE")) D Q
  1. ..S SIZEC=^TMP("OCXCMP",$J,"C CODE",+CSUB,"SIZE")
  1. ..I $D(^TMP("OCXCMP",$J,"C CODE",+CSUB,"CALLS")) D
  1. ...K OCXEFC M OCXEFC=^TMP("OCXCMP",$J,"C CODE",+CSUB,"CALLS")
  1. .K OCXREC M OCXREC=^TMP("OCXCMP",$J,"C CODE",+CSUB)
  1. .S D0=0 F S D0=$O(OCXREC(D0)) Q:'D0 D
  1. ..S TEXT=OCXREC(D0,0),SIZEC=SIZEC+$L(TEXT)
  1. ..Q:'(TEXT["$$")
  1. ..F PIEC=2:1:$L(TEXT,"$$") D
  1. ...S EFC=$P($P(TEXT,"$$",PIEC),"(",1)
  1. ...S:(EFC[" ") EFC=$P(EFC," ",1) Q:(EFC["^") Q:'$L(EFC)
  1. ...I '$D(^TMP("OCXCMP",$J,"INCLUDE",EFC)) D Q
  1. ....D WARN^OCXOCMPV("Unknown Local Extrinsic Function: "_EFC,$P($T(+1)," ",1)) Q
  1. ...S OCXEFC(EFC)=""
  1. .S SIZEC=SIZEC+100 ; ADJUST FOR SUBROUTINE DOCUMENTATION
  1. .S ^TMP("OCXCMP",$J,"C CODE",+CSUB,"SIZE")=SIZEC
  1. .M ^TMP("OCXCMP",$J,"C CODE",+CSUB,"CALLS")=OCXEFC
  1. ;
  1. I $G(DSUB),$D(^TMP("OCXCMP",$J,"D CODE",+DSUB)) D
  1. .I $G(^TMP("OCXCMP",$J,"D CODE",+DSUB,"SIZE")) D Q
  1. ..S SIZED=^TMP("OCXCMP",$J,"D CODE",+DSUB,"SIZE")
  1. ..I $D(^TMP("OCXCMP",$J,"D CODE",+DSUB,"CALLS")) D
  1. ...K OCXEFD M OCXEFD=^TMP("OCXCMP",$J,"D CODE",+DSUB,"CALLS")
  1. ;
  1. K OCXEFF M OCXEFF=OCXEFC,OCXEFF=OCXEFD
  1. ;
  1. I $D(OCXEFF) S EFC="" F S EFC=$O(OCXEFF(EFC)) Q:'$L(EFC) I 'OCXEFF(EFC) D
  1. .K OCXTEMP
  1. .I $D(^TMP("OCXCMP",$J,"INCLUDE",EFC,"SIZE")) M OCXTEMP("SIZE")=^TMP("OCXCMP",$J,"INCLUDE",EFC,"SIZE")
  1. .I $D(^TMP("OCXCMP",$J,"INCLUDE",EFC,"CALLS")) M OCXTEMP("CALLS")=^TMP("OCXCMP",$J,"INCLUDE",EFC,"CALLS")
  1. .S OCXEFF(EFC)=OCXTEMP("SIZE")
  1. .Q:'$D(OCXTEMP("CALLS"))
  1. .S EFC="" F S EFC=$O(OCXTEMP("CALLS",EFC)) Q:'$L(EFC) S OCXEFF(EFC)=+$G(OCXEFF(EFC))
  1. ;
  1. I $D(OCXEFF) S EFC="" F S EFC=$O(OCXEFF(EFC)) Q:'$L(EFC) S SIZEF=SIZEF+OCXEFF(EFC)
  1. ;
  1. Q $G(SIZEC)+$G(SIZED)+$G(SIZEF)
  1. ;
  1. RNAM(X) ;
  1. N CHAR
  1. S CHAR="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  1. Q "OCXOZ"_$E(CHAR,(X\36+1))_$E(CHAR,(X#36+1))
  1. ;
  1. TODAY() N X,Y,%DT S X="T",%DT="" D ^%DT X ^DD("DD") Q Y
  1. ;
  1. NOW() N X,Y,%DT S X="N",%DT="T" D ^%DT X ^DD("DD") S:(Y["@") Y=$P(Y,"@",1)_" at "_$P(Y,"@",2,99) Q Y
  1. ;