ZTGS ;SF/RWF - GLOBAL SEARCH ;12/6/89 14:01 ; [ 04/02/2003 8:29 AM ]
;;8.0;KERNEL;1002,1003,1004,1005,1005,1007**;APR 1, 2003
;;7.3;TOOLKIT;;Apr 25, 1995
S:'$D(DTIME) DTIME=600
A W !,"GLOBAL SEARCH",!,"Global reference: " R GREF:DTIME G QUIT:(GREF="^")!(GREF="")
S:$E(GREF)'="^" GREF="^"_GREF S:GREF'["(" GREF=GREF_"("
S GBL=GREF S:$E(GBL,$L(GBL))="," GBL=$E(GBL,1,$L(GBL)-1) S:$E(GBL,$L(GBL))'=")" GBL=GBL_")" S:$E(GREF,$L(GREF))=")" GREF=$E(GREF,1,$L(GREF)-1)
S:GBL["()" GBL=$P(GBL,"()",1)_"(-9)" S GBLSTART=GBL
I $Q(@GBL)="" W !,"Non-existing global." G A
B R !,"Search for: ",VAL:DTIME,! G QUIT:VAL="^",A:VAL="" S GBL=GBLSTART
;I '$D(@GBL) S X=$O(@GBL),GBL=$ZR
I $D(@GBL)#2,@GBL[VAL W !,GBL,"=",@GBL,!
F I=1:1 S GBL=$Q(@GBL) Q:GBL'[GREF W:I#25=0 "." I @GBL[VAL W !,GBL,"=",@GBL,!
G B
QUIT K GBL,GREF,VAL Q
ZTGS ;SF/RWF - GLOBAL SEARCH ;12/6/89 14:01 ; [ 04/02/2003 8:29 AM ]
+1 ;;8.0;KERNEL;1002,1003,1004,1005,1005,1007**;APR 1, 2003
+2 ;;7.3;TOOLKIT;;Apr 25, 1995
+3 IF '$DATA(DTIME)
SET DTIME=600
A WRITE !,"GLOBAL SEARCH",!,"Global reference: "
READ GREF:DTIME
IF (GREF="^")!(GREF="")
GOTO QUIT
+1 IF $EXTRACT(GREF)'="^"
SET GREF="^"_GREF
IF GREF'["("
SET GREF=GREF_"("
+2 SET GBL=GREF
IF $EXTRACT(GBL,$LENGTH(GBL))=","
SET GBL=$EXTRACT(GBL,1,$LENGTH(GBL)-1)
IF $EXTRACT(GBL,$LENGTH(GBL))'=")"
SET GBL=GBL_")"
IF $EXTRACT(GREF,$LENGTH(GREF))=")"
SET GREF=$EXTRACT(GREF,1,$LENGTH(GREF)-1)
+3 IF GBL["()"
SET GBL=$PIECE(GBL,"()",1)_"(-9)"
SET GBLSTART=GBL
+4 IF $QUERY(@GBL)=""
WRITE !,"Non-existing global."
GOTO A
B READ !,"Search for: ",VAL:DTIME,!
IF VAL="^"
GOTO QUIT
IF VAL=""
GOTO A
SET GBL=GBLSTART
+1 ;I '$D(@GBL) S X=$O(@GBL),GBL=$ZR
+2 IF $DATA(@GBL)#2
IF @GBL[VAL
WRITE !,GBL,"=",@GBL,!
+3 FOR I=1:1
SET GBL=$QUERY(@GBL)
IF GBL'[GREF
QUIT
IF I#25=0
WRITE "."
IF @GBL[VAL
WRITE !,GBL,"=",@GBL,!
+4 GOTO B
QUIT KILL GBL,GREF,VAL
QUIT