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

AURSRCH2.m

Go to the documentation of this file.
AURSRCH2 ; SEARCH INPUT TRANSFORM FOR ROUTINES [ 04/06/88  8:29 AM ]
 ; PREVIOUSLY NAMED AUSINP
 ;
 W !!,"This routine searches a file for INPUT TRANSFORMS that call routines.",!
 S U="^"
 S DIC="^DIC(",DIC(0)="AEMQ" D ^DIC
 I Y<0 D EOJ Q
 S AUSINP("FILE")=+Y
 K ^UTILITY("AURSRCH",$J)
 S AUSINP("MASTER")=""
EN ; ENTRY POINT FOR CALLING ROUTINES
 S AUSINP("LAST FILE")=""
 D SBTRACE
 D:$D(AUSINP("MASTER")) LIST
 D EOJ
 Q
SBTRACE ; CHECK ALL SUB-FILES
 K AUSINPFL S AUSINP("CNT")=1,AUSINPFL(AUSINP("CNT"))=AUSINP("FILE")
 F AUSINP("L")=0:0 S AUSINP("LCTL")=$O(AUSINPFL("")) Q:AUSINP("LCTL")=""  S AUSINP("FILE")=AUSINPFL(AUSINP("LCTL")) D SBTRACE2 S AUSINP("LCTL")=$O(AUSINPFL("")) D FILE K AUSINPFL(AUSINP("LCTL"))
 Q
SBTRACE2 ;
 S AUSINP("LCTL")=0 F AUSINP("L")=0:0 S AUSINP("LCTL")=$O(^DD(AUSINP("FILE"),"SB",AUSINP("LCTL"))) Q:AUSINP("LCTL")=""  S AUSINP("CNT")=AUSINP("CNT")+1,AUSINPFL(AUSINP("CNT"))=AUSINP("LCTL")
 Q
 ;
FILE ; CHECK ONE FILE OR SUB-FILE
 S AUSINP("FIELD")=0
 F AUSINP("L")=0:0 S AUSINP("FIELD")=$O(^DD(AUSINP("FILE"),AUSINP("FIELD"))) Q:AUSINP("FIELD")'=+AUSINP("FIELD")  D FIELD
 Q
 ;
FIELD ; CHECK FIELD'S INPUT TRANSFORM
 S X=$P(^(AUSINP("FIELD"),0),U,5,99)
 Q:X'[U
 S AURSRCH("FOUND")=0,AUSINP("COUNT")=$L(X,U)
 F AUSINP("I")=AUSINP("COUNT"):-1:2 S Y=$P(X,U,AUSINP("I")) D ^AURSRCH1
 D:AURSRCH("FOUND") WRITE
 Q
 ;
WRITE ;
 I $D(AURSRCH("NO DETAIL")) W "." Q
 I AUSINP("FILE")'=AUSINP("LAST FILE") S AUSINP("LAST FILE")=AUSINP("FILE") W !
 W !,AUSINP("FILE"),",",AUSINP("FIELD"),?20,$E(X,1,59)
 F AUSINP("L")=0:0 S X=$E(X,60,999) Q:X=""  W !,?20,$E(X,1,59)
 Q
 ;
LIST ; LIST ROUTINE NAMES
 Q:'$D(^UTILITY("AURSRCH",$J))
 W !!,"Sorted list of routines found:",!
 S X="" F AUSINP("L")=0:0 S X=$O(^UTILITY("AURSRCH",$J,X)) Q:X=""  W !,"^",X
 K ^UTILITY("AURSRCH",$J)
 W !
 Q
 ;
EOJ ;
 K DIC
 K X,X0,X1,X2,Y,YY
 K:$D(AUSINP("MASTER")) AURSRCH
 K AUSINP,AUSINPFL
 Q