AZHLSC47 ; IHS/HQW/JN - SAC CHAPTER 2: M LANGUAGE PROGRAMMING STANDARDS & CONVENTIONS ; [ 01/20/2000 8:30 AM ] [1/20/00 9:44am]
;;5.0;AZHLSC;;JAN 17,1997
EN ;EP FIND COMMENT OR TEXT
S Z1=Z(Z)
S (AZHLSC4I,AZHLSCF)=0
S AZHLSCF=$E(Z1,2,99) I $E(AZHLSCF,1,1)=";" S AZHLSC4I=1 G AZHLSCKV
D:$E(AZHLSCF,1,1)="." CHKDOTS
AZHLSCKV ; KILL VARIABLES
K AZHLSCF,Z1,AZHLSCSV
Q
CHKDOTS ; CHECK FOR DO DOTS BEFORE SEMI-COLON IN COMMENTED LINE
I AZHLSCF="" G CHKBLK
F I=1:1:$L(AZHLSCF) S AZHLSCSV=I Q:$E(AZHLSCF,I,I)=";" D DOTBLK Q:AZHLSC4I=1 Q:AZHLSC4I=2
I $E(AZHLSCF,AZHLSCSV,AZHLSCSV)=";" S AZHLSC4I=1 Q
Q
DOTBLK ; CHECK FOR DO DOTS, SEMI-COLON AND IMBEDDED BLANKS
I $E(AZHLSCF,I,I)="." Q
I $E(AZHLSCF,I,I)=" " Q
I $E(AZHLSCF,I,I)=";" S AZHLSC4I=1 Q
S AZHLSC4I=2 Q ;
CHKBLK ; CHECK FOR BLANK BEFORE SEMI-COLON IN COMMENTED LINE
S AZHLSCF=$P(Z1," ",1)_" "
F I=$L(AZHLSCF):1:$L(Z1) S AZHLSCSV=I I $E(Z1,I,I)'=" " Q
I $E(Z1,AZHLSCSV,AZHLSCSV)=";" S AZHLSC4I=1 Q
Q
AZHLSC47 ; IHS/HQW/JN - SAC CHAPTER 2: M LANGUAGE PROGRAMMING STANDARDS & CONVENTIONS ; [ 01/20/2000 8:30 AM ] [1/20/00 9:44am]
+1 ;;5.0;AZHLSC;;JAN 17,1997
EN ;EP FIND COMMENT OR TEXT
+1 SET Z1=Z(Z)
+2 SET (AZHLSC4I,AZHLSCF)=0
+3 SET AZHLSCF=$EXTRACT(Z1,2,99)
IF $EXTRACT(AZHLSCF,1,1)=";"
SET AZHLSC4I=1
GOTO AZHLSCKV
+4 IF $EXTRACT(AZHLSCF,1,1)="."
DO CHKDOTS
AZHLSCKV ; KILL VARIABLES
+1 KILL AZHLSCF,Z1,AZHLSCSV
+2 QUIT
CHKDOTS ; CHECK FOR DO DOTS BEFORE SEMI-COLON IN COMMENTED LINE
+1 IF AZHLSCF=""
GOTO CHKBLK
+2 FOR I=1:1:$LENGTH(AZHLSCF)
SET AZHLSCSV=I
IF $EXTRACT(AZHLSCF,I,I)=";"
QUIT
DO DOTBLK
IF AZHLSC4I=1
QUIT
IF AZHLSC4I=2
QUIT
+3 IF $EXTRACT(AZHLSCF,AZHLSCSV,AZHLSCSV)=";"
SET AZHLSC4I=1
QUIT
+4 QUIT
DOTBLK ; CHECK FOR DO DOTS, SEMI-COLON AND IMBEDDED BLANKS
+1 IF $EXTRACT(AZHLSCF,I,I)="."
QUIT
+2 IF $EXTRACT(AZHLSCF,I,I)=" "
QUIT
+3 IF $EXTRACT(AZHLSCF,I,I)=";"
SET AZHLSC4I=1
QUIT
+4 ;
SET AZHLSC4I=2
QUIT
CHKBLK ; CHECK FOR BLANK BEFORE SEMI-COLON IN COMMENTED LINE
+1 SET AZHLSCF=$PIECE(Z1," ",1)_" "
+2 FOR I=$LENGTH(AZHLSCF):1:$LENGTH(Z1)
SET AZHLSCSV=I
IF $EXTRACT(Z1,I,I)'=" "
QUIT
+3 IF $EXTRACT(Z1,AZHLSCSV,AZHLSCSV)=";"
SET AZHLSC4I=1
QUIT
+4 QUIT