source: FOIAVistA/trunk/r/TOOLKIT-AWCM-XD-XIN-XPAR-XQAB-XT-XUC-XUR-ZIN-ZTED/XTFC1.m@ 1780

Last change on this file since 1780 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 4.4 KB
Line 
1XTFC1 ;SF-ISC.SEA/JLI - FLOW CHART GENERATION ;12/7/95 14:50
2 ;;7.3;TOOLKIT;**8**;Apr 25, 1995
3SETIT ;
4 W:IOST["C-" "."
5 S XTX1B=$P(XTXB," ",1),XTXB=$P(XTXB," ",2,999),XTX1=$E(X,1,$L(XTX1B)),X=$E(X,$L(XTX1B)+2,$L(X))
6 F XTIJ=0:0 Q:XTX1B="" S XTX2B=$P(XTX1B,",",1),XTX1B=$P(XTX1B,",",2,999),XTX2=$E(XTX1,1,$L(XTX2B)),XTX1=$E(XTX1,$L(XTX2)+2,$L(XTX1)) D SETIT1
7 Q
8SETIT1 ;
9 N % D PSET S:(XTNAM["DO"!(XTNAM["GOTO"))&($P(XTX2,"(")'["^") %=$P(XTX2,"(",2,99),XTX2=$P(XTX2,"(")_"^"_XTROU_$S($L(%):"("_%,1:"")
10 S XTENTR=XTENTR+1,^TMP($J,XTLEV,"FC",XTENTR,XTNAM)=XTOFF_XTL1_XTX2_XTL2 D QTCHK,PCLR
11 Q
12 ;
13DO I $E(XTXB,1,6)'="&ARGLS"&(XTXB'="") S XTNAM="DO ",XTL1="[ ",XTL2=" ]" G SETIT
14 I $D(XTEXT(0)) D S XTENTR=XTENTR+1,^TMP($J,XTLEV,"FC",XTENTR,"ARGLS")=XTOFF_"[REPEAT OF LAST ARGLESS DO "_XX_"]" S X=$P(X," ",2,999),XTXB=$P(XTXB," ",2,999) Q
15 . S XX="" F ENAD1=1:1:(XTDPER+1) S XX=XX_"."
16 S XTEXTB(XTDPER+1)=$P(XTXB," ",2,999),XTEXT(XTDPER+1)=$P(X," ",2,999),XTOFF(XTDPER+1)=XTOFF,XTIFLG(XTDPER+1)=XTIFLG,XTFFLG(XTDPER+1)=XTFFLG,XTCOND(XTDPER+1)=XTCOND
17 D S X="",XTXB="",XTENTR=XTENTR+1,^TMP($J,XTLEV,"FC",XTENTR,"ARGLS")=XTOFF_"-- START OF ARGLESS DO "_XX_"--"
18 . S XX="" F ENAD1=1:1:(XTDPER+1) S XX=XX_"."
19 Q
20ENAD ; END OF NON ARGUMENT DO
21 D S XTENTR=XTENTR+1,^TMP($J,XTLEV,"FC",XTENTR,"ENAD ")=XTOFF_"-- END OF ARGUMENTLESS DO "_XX_"--"
22 . S XX="" F ENAD1=1:1:XTDPER S XX=XX_"."
23 . S XTOFF=XTOFF(XTDPER),XTIFLG=XTIFLG(XTDPER),XTCOND=XTCOND(XTDPER),XTFFLG=XTFFLG(XTDPER)
24 Q
25 ;
26GO S XTNAM="GOTO ",XTL1="{ ",XTL2=" }" G SETIT
27 ;
28KILL S XTNAM="PROC ",XTL1="KILL ",XTL2="" G SETIT
29 ;
30LOCK S XTNAM="PROC ",XTL1="LOCK ",XTL2="" G SETIT
31MERGE S XTNAM="MERGE",XTL1="MERGE ",XTL2="" G SETIT
32ESTART S XTNAM="ESTAR",XTL1="ESTART ",XTL2="" G SETIT
33ESTOP S XTNAM="ESTOP",XTL1="ESTOP ",XTL2="" G SETIT
34 ;
35ETRIG S XTNAM="ETRIG",XTL1="ETRIGGER ",XTL2="" G SETIT
36 ;
37NEW S XTNAM="PROC ",XTL1="NEW ",XTL2="" G SETIT
38 ;
39JOB S XTNAM="JOB ",XTL1="JOB ",XTL2="" G SETIT
40 ;
41BREAK S XTNAM="PROC ",XTL1="BREAK ",XTL2="" G SETIT
42 ;
43CLOSE S XTNAM="PROC ",XTL1="CLOSE ",XTL2="" G SETIT
44 ;
45OPEN S XTNAM="PROC ",XTL1="OPEN ",XTL2="" G SETIT
46 ;
47USE S XTNAM="PROC ",XTL1="USE ",XTL2="" G SETIT
48 ;
49SET S XTNAM="PROC ",XTL1="SET ",XTL2="" G SETIT
50VIEW S XTNAM="VIEW ",XTL1="VIEW ",XTL2="" G SETIT
51ZCMND S XTNAM="ZCMND",XTL1=XTXO_" ",XTL2="" G SETIT
52 ;
53HALT ;
54 S XTX1B=$P(XTXB," ",1),XTXB=$P(XTXB," ",2,999),XTX1=$E(X,1,$L(XTX1B)),X=$E(X,$L(XTX1B)+2,$L(X)),XTENTR=XTENTR+1,^TMP($J,XTLEV,"FC",XTENTR,"HALT ")=XTOFF_" *** "_$S(XTX1>0:"HANG "_(+XTX1),1:"HALT")_" ***"
55 Q
56 ;
57READ ;
58 S XTX1B=$P(XTXB," ",1),XTXB=$P(XTXB," ",2,999),XTX1=$E(X,1,$L(XTX1B)),X=$E(X,$L(XTX1B)+2,$L(X)),XTENTR=XTENTR+1,^TMP($J,XTLEV,"FC",XTENTR,"READ ")=XTOFF_"READ--- "_XTX1
59 Q
60 ;
61WRITE ;
62 S XTX1B=$P(XTXB," ",1),XTXB=$P(XTXB," ",2,999),XTX1=$E(X,1,$L(XTX1B)),X=$E(X,$L(XTX1B)+2,$L(X)),XTENTR=XTENTR+1,^TMP($J,XTLEV,"FC",XTENTR,"WRITE")=XTOFF_"WRITE--- "_XTX1
63 Q
64 ;
65XECUT ;
66 S XTX1B=$P(XTXB," ",1),XTXB=$P(XTXB," ",2,999),XTX1=$E(X,1,$L(XTX1B)),X=$E(X,$L(XTX1B)+2,$L(X)),XTENTR=XTENTR+1,^TMP($J,XTLEV,"FC",XTENTR,"PROC ")=XTOFF_"Xecute "_XTX1
67 Q
68QUIT ; Quit command
69 S XTX1B=$P(XTXB," ",1),XTXB=$P(XTXB," ",2,999),XTX1=$E(X,1,$L(XTX1B)),X=$E(X,$L(XTX1B)+2,$L(X))
70 S XTENTR=XTENTR+1,^TMP($J,XTLEV,"FC",XTENTR,"QUIT ")=XTOFF_$S(XTFFLG=0:" *** QUIT"_$S(XTX1'="":" "_XTX1,1:"")_" ***",1:"( QUIT FOR "_$S(XTX1'="":" "_XTX1_" ",1:"")_")") I 'XTFFLG&(XTOFF="") S XTTFLG=1
71 Q
72 ;
73IF ;
74 S XTX2B=$P(XTXB," ",1),XTXB=$P(XTXB," ",2,999),XTX1=$E(X,1,$L(XTX2B)),X=$E(X,$L(XTX2B)+2,$L(X))
75 S XTCOND=XTCOND+1,XTIFLG=XTIFLG+1,XTENTR=XTENTR+1,^TMP($J,XTLEV,"FC",XTENTR,"IF ")=XTOFF_"< "_XTX1_" >",XTOFF=XTOFF_"...."
76 Q
77 ;
78FOR ;
79 S XTXB1=$P(XTXB," ",1),XTXB=$P(XTXB," ",2,999),XTX1=$E(X,1,$L(XTXB1)),X=$E(X,$L(XTXB1)+2,999),XTENTR=XTENTR+1
80 S ^TMP($J,XTLEV,"FC",XTENTR,"FOR ")=XTOFF_"F "_$S($E(XTX1,1,6)="&ARGLS":"",1:XTX1),XTOFF=XTOFF_" ",XTFFLG=1
81 Q
82 ;
83ELSE ;
84 S XTENTR=XTENTR+1,XTCOND=XTCOND+1,XTIFLG=XTIFLG+1,^TMP($J,XTLEV,"FC",XTENTR,"ELSE ")=XTOFF_"< ELSE... >",XTOFF=XTOFF_"...."
85 Q
86PSET ; Set post-conditional if it applies
87 S XTPCOND=$S(XTX2B[":":1,1:0) Q:'XTPCOND
88 S XTX2B=$P(XTX2B,":",1),XTXCOND=$E(XTX2,$L(XTX2B)+2,$L(XTX2)),XTX2=$E(XTX2,1,$L(XTX2B))
89 S XTCOND=XTCOND+1,XTENTR=XTENTR+1,^TMP($J,XTLEV,"FC",XTENTR,"DECIS")=XTOFF_"< "_XTXCOND_" >",XTOFF=XTOFF_"...."
90 Q
91 ;
92PCLR ;
93 Q:'XTPCOND
94 S XTCOND=XTCOND-1,XTOFF=$E(XTOFF,1,$L(XTOFF)-4)
95 Q
96QTCHK ; Check if Quit Flag should be set
97 I XTNAM="GOTO "!(XTNAM="HALT ") I XTOFF="" S XTTFLG=1
98 Q
Note: See TracBrowser for help on using the repository browser.