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

AZHLSCU4.m

Go to the documentation of this file.
  1. AZHLSCU4 ; IHS/ADC/GTH:KEU - UNDEF CHECKER. PROCESS DO, GO TO, WRITE & FOR COMMANDS ;
  1. ;;5.0;AZHLSC;;JUL 10, 1996
  1. DG1 I ARG="" S:'IND("DO1") IND("DO")=IND("DO")+1,IND("DO1")=1 Q
  1. DG S (LBL,PGM,OFF,PRM)="",S=1,L="+^:," S:$E(ARG,1,2)="@^" S=3
  1. D LOOP S LBL=$E(ARG,1,I-1)
  1. I CH="+" S (J,S)=I+1 S:$E(ARG,I)="^" S=I+1 D LOOP S OFF=$E(ARG,J,I-1) I OFF'?.N S GRB=GRB_$C(9)_OFF
  1. I CH="^" S S=I+1 D LOOP S PGM=$E(ARG,S,I-1)
  1. I CH=":" S S=I+1,L="," D LOOP S S=$E(ARG,S,I-1) I S'="" S GRB=GRB_$C(9)_S
  1. S ARG=$E(ARG,I+1,999)
  1. I $E(LBL)="@" S GRB=GRB_$C(9)_$E(LBL,2,999),LBL="@("
  1. I $E(PGM)="@" S GRB=GRB_$C(9)_$E(PGM,2,999),PGM="@("
  1. I LBL[")" S PRM=$$INSIDE(LBL,"(",")"),LBL=$P(LBL,"(")
  1. I PGM[")" S PRM=$$INSIDE(PGM,"(",")"),PGM=$P(PGM,"(")
  1. I PRM]"" S GRB=GRB_$C(9)_PRM D PC
  1. S:OFF'="" LBL=LBL_"+"_OFF
  1. S S="",LOC="I" I PGM'="" S S=S_PGM_" ",LOC="X"
  1. S:LBL'="" S=S_LBL I S'="" D ST
  1. G:ARG'="" DG
  1. ; K LBL,PGM,OFF,PRM
  1. Q
  1. LOOP F I=S:1 S CH=$E(ARG,I) D QUOTE:CH=Q,PAREN:CH="(",ERRCP:CH=")" Q:L[CH
  1. Q
  1. PAREN S PC=1
  1. F I=I+1:1 S CH=$E(ARG,I) Q:PC=0!(CH="") I "()"""[CH D QUOTE:CH=Q S PC=PC+$S("("[CH:1,")"[CH:-1,1:0)
  1. Q
  1. QUOTE F I=I+1:1 S CH=$E(ARG,I) Q:CH=""!(CH=Q)
  1. Q
  1. ST S R=$F(S,"(") S:R>1 S=$E(S,1,R-1) S:"IX"[LOC IND("COM")=IND("COM")_","_S
  1. S:'$D(V(LOC,S)) V(LOC,S)="" S:LOC="L"&(V(LOC,S)'["*") V(LOC,S)=V(LOC,S)_"*" Q
  1. Q
  1. FR Q:$E(ARG,1)="@" S S=2,L="=" D LOOP
  1. S GK="*",STR=$E(ARG,1,I-1),ARG=$E(ARG,I+1,999) D ARGG^AZHLSCU2
  1. Q
  1. WR S STR=ARG D ARGG^AZHLSCU2 S ARG=""
  1. Q
  1. ERRCP Q
  1. SET S ARG=$E(ARG,1,I-1)_","_$E(ARG,I+1,999) Q
  1. XE S GRB=GRB_$C(9)_ARG,ARG="" Q
  1. REP S L=",:",S=1 D LOOP I CH=":" S ARG=$E(ARG,I+1,999),L="," D LOOP
  1. S ARG=$E(ARG,I+1,999) Q:ARG="" G REP
  1. ZC I "ILRS"'[$E(CM,2)!($E(CM,2)="") S ARG="" Q ;Zcommands
  1. S COM=$E(CM,1,2) Q:CM="ZI" G:CM="ZR" ZR
  1. U1 S L=",",S=1 D LOOP S S=$E(ARG,1,I-1),ARG=$E(ARG,I+1,999)
  1. S:$E(S,1)="@" S=$E(S,2,999),GRB=GRB_$C(9)_S Q:ARG="" G U1
  1. ZR Q:ARG="" S L=":,",S=1 D LOOP S S=$E(ARG,1,I-1),ARG=$E(ARG,I+1,999)
  1. I $E(S,1)="@" S GRB=GRB_$C(9)_S G ZR
  1. S:S["+" GRB=GRB_$C(9)_$P(S,"+",2,999) G ZR
  1. LO S GRB=GRB_$C(9)_ARG,ARG="" Q
  1. Q ;QUIT
  1. I IND("PP") S GRB=GRB_$C(9)_ARG,ARG=""
  1. Q
  1. PT(X) ;Tag for parameter passing
  1. S ^UTILITY($J,1,RTN,"P",LAB)=X Q
  1. PC ;Parameter passing call
  1. N LOC S LOC="P" D ST Q
  1. INSIDE(X,X1,X2) ;Return the data inside the param x1,x2
  1. S J=$L(X,X2)-1,J=$S(J<1:1,1:J)
  1. Q $P($P(X,X2,1,J),X1,2,99)