AZHLSC54 ; IHS/HQW/JN - SAC CHAPTER 2: M LANGUAGE PROGRAMMING STANDARDS & CONVENTIONS ; [ 03/05/97 10:18 AM ] [1/13/00 2:21pm]
;;5.0;AZHLSC;;JAN 17,1997
EN ;EP FIND CONDITIONAL AND ^% GLOBALS IN STRING
D EN^AZHLSC46 Q:AZHLSC4I=1
I Z(Z)["K ^%"!(Z(Z)["S ^%") D AZHLSET Q
S AZHLSCF=$F(Z(Z),"^%") Q:AZHLSCF=0
I $E(Z(Z),AZHLSCF-3,AZHLSCF-1)=",^%" D AZHLSTR Q
I $E(Z(Z),AZHLSCF-3,AZHLSCF-1)=" ^%" D AZHLSCCO Q
Q
AZHLSTR ; SEARCH FOR K OR S FOR IMBEDED % GL
F I=AZHLSCF:-1 Q:I<1 I $E(Z(Z),I)[" " D AZHLSEAR Q
Q
AZHLSCCO ; SEARCH FOR CONDITIONAL K OR S
F I=AZHLSCF:-1 Q:I<1 I $E(Z(Z),I)=":" D AZHLSUB Q:AZHLNM>12 D AZHLSEAR Q
Q
AZHLSEAR ;
I $E(Z(Z),I-2,I-1)=" K" D AZHLSET Q
I $E(Z(Z),I-2,I-1)=" S" D AZHLSET Q
Q
AZHLSET ;
K AZHLSCF,I,AZHLNM S ^TMP($J,"2.3.2.4",AZHL0,AZHLB)=^TMP($J,"Z")
Q
AZHLSUB ;
S AZHLNM=AZHLSCF-I Q
AZHLSC54 ; IHS/HQW/JN - SAC CHAPTER 2: M LANGUAGE PROGRAMMING STANDARDS & CONVENTIONS ; [ 03/05/97 10:18 AM ] [1/13/00 2:21pm]
+1 ;;5.0;AZHLSC;;JAN 17,1997
EN ;EP FIND CONDITIONAL AND ^% GLOBALS IN STRING
+1 DO EN^AZHLSC46
IF AZHLSC4I=1
QUIT
+2 IF Z(Z)["K ^%"!(Z(Z)["S ^%")
DO AZHLSET
QUIT
+3 SET AZHLSCF=$FIND(Z(Z),"^%")
IF AZHLSCF=0
QUIT
+4 IF $EXTRACT(Z(Z),AZHLSCF-3,AZHLSCF-1)=",^%"
DO AZHLSTR
QUIT
+5 IF $EXTRACT(Z(Z),AZHLSCF-3,AZHLSCF-1)=" ^%"
DO AZHLSCCO
QUIT
+6 QUIT
AZHLSTR ; SEARCH FOR K OR S FOR IMBEDED % GL
+1 FOR I=AZHLSCF:-1
IF I<1
QUIT
IF $EXTRACT(Z(Z),I)[" "
DO AZHLSEAR
QUIT
+2 QUIT
AZHLSCCO ; SEARCH FOR CONDITIONAL K OR S
+1 FOR I=AZHLSCF:-1
IF I<1
QUIT
IF $EXTRACT(Z(Z),I)=":"
DO AZHLSUB
IF AZHLNM>12
QUIT
DO AZHLSEAR
QUIT
+2 QUIT
AZHLSEAR ;
+1 IF $EXTRACT(Z(Z),I-2,I-1)=" K"
DO AZHLSET
QUIT
+2 IF $EXTRACT(Z(Z),I-2,I-1)=" S"
DO AZHLSET
QUIT
+3 QUIT
AZHLSET ;
+1 KILL AZHLSCF,I,AZHLNM
SET ^TMP($JOB,"2.3.2.4",AZHL0,AZHLB)=^TMP($JOB,"Z")
+2 QUIT
AZHLSUB ;
+1 SET AZHLNM=AZHLSCF-I
QUIT