1 | DIM3 ;SFISC/JFW,GFT,TOAD-FileMan: M Syntax Checker, Commands ;5/6/97 09:10
|
---|
2 | ;;22.0;VA FileMan;;Mar 30, 1999
|
---|
3 | ;Per VHA Directive 10-93-142, this routine should not be modified.
|
---|
4 | ;12278;4265731;3363;
|
---|
5 | ;
|
---|
6 | DG ; DO and GET (D^DIM and G^DIM)
|
---|
7 | G GC^DIM:%ARG=""!%ERR D PARS G ER:%ERR
|
---|
8 | S %L=":" D PARS1 G ER:%ERR I %C=%L G ER:%A1="" S %=%A1 D ^DIM1
|
---|
9 | I %A["@^" S %=%A D ^DIM1 G DG
|
---|
10 | I %A["(",$E(%A)'="@",$E($P(%A,"^",2))'="@" D G ER:%ERR
|
---|
11 | . I %COM'="D" S %ERR=1 Q
|
---|
12 | . S %=%A
|
---|
13 | . I %'?.E1"(".E1")" S %ERR=1 Q
|
---|
14 | . S %C=$P(%,"("),%C1=$P(%C,"^",2,999),%I=$F(%,"(")-1
|
---|
15 | . I %C=""!(%C?.E1"^") S %ERR=1 Q
|
---|
16 | . I %C1]"",%C1'?1U.7AN,%C1'?1"%".7AN S %ERR=1 Q
|
---|
17 | . S %C=$P(%C,"^") I %C]"",%C'?1U.7AN,%C'?1"%".7AN,%C'?1.8N S %ERR=1 Q
|
---|
18 | . Q:$E(%,%I,%I+1)="()"
|
---|
19 | . S (%(-1,2),%(-1,3))=0,%N=1,%(0,0)="P^",(%(0,1),%(0,2),%(0,3))=0
|
---|
20 | . D GG^DIM1
|
---|
21 | E D LABEL(0)
|
---|
22 | G DG
|
---|
23 | ;
|
---|
24 | LABEL(OFFSET) ; labelref, entryref, and $TEXT argument (DG and TEXT^DIM1)
|
---|
25 | S %L="^" D PARS1 Q:%ERR
|
---|
26 | I %C=%L S:%A1=""!($E(%A1)="^") %ERR=1 S %=%A1 D VV,^DIM1 Q:%ERR
|
---|
27 | S %=%A D VV:%'=+%&'OFFSET,^DIM1 Q
|
---|
28 | ;
|
---|
29 | KL ; KILL, LOCK, and NEW (K^DIM and LK)
|
---|
30 | D PARS G ER:%ERR
|
---|
31 | I %A="",%C="," G ER
|
---|
32 | I %A?1"^"1UP.UN,%COM'="L" G ER
|
---|
33 | I %A?1"(".E1")" D G KL
|
---|
34 | . S %ARG("E")=$L(%ARG)
|
---|
35 | . S %A=$E(%A,2,$L(%A)-1) S %ARG=%A_$S(%ARG]"":","_%ARG,1:"")
|
---|
36 | S %=%A I %COM="L","+-"[$E(%A) S $E(%A)=""
|
---|
37 | I %COM="N",'$$LNAME(%) G ER
|
---|
38 | I %COM="K",$D(%ARG("E")),'$$LNAME(%) G ER
|
---|
39 | I $D(%ARG("E")),$L(%ARG)'>%ARG("E") K %ARG("E")
|
---|
40 | D VV,^DIM1 G GC^DIM:%ARG=""!%ERR
|
---|
41 | G KL
|
---|
42 | ;
|
---|
43 | LK ; LOCK (L^DIM)
|
---|
44 | S %A=%ARG,%L=":" S:"+-"[$E(%A) %A=$E(%A,2,999) D PARS1
|
---|
45 | I %C=%L G ER:%A1="" S %=%A1 D ^DIM1
|
---|
46 | S %ARG=%A G GC^DIM:%A="",KL
|
---|
47 | ;
|
---|
48 | HN ; HANG (H^DIM)
|
---|
49 | S %=%ARG D ^DIM1 G GC^DIM
|
---|
50 | ;
|
---|
51 | OP ; OPEN and USE (O^DIM and U^DIM)
|
---|
52 | G GC^DIM:%ARG=""!%ERR D PARS G ER:%ERR!(%C=","&(%A=""))
|
---|
53 | G US:%COM="U" S %L=":" D PARS1 S %A2=%A,%A=%A1 S:%C=%L&(%A="") %ERR=1 D PARS1 G ER:%ERR!(%C=%L&(%A1=""))
|
---|
54 | F %L="%A1","%A2" S %=@%L D ^DIM1 G OP:%ERR
|
---|
55 | G OP
|
---|
56 | US S %L=":" D PARS1 G ER:%C=%L&(%A1="") S %=%A D ^DIM1
|
---|
57 | S %A=%A1 D PARS1 G ER:%C]"",OP
|
---|
58 | ;
|
---|
59 | FR ; FOR (F^DIM)
|
---|
60 | S %L="=",%A=%ARG D PARS1 G ER:%ERR!(%A1="")!(%A="") S %ARG=%A1
|
---|
61 | S %=%A G ER:%A?1"^".E D VV,^DIM1 G ER:%ERR
|
---|
62 | FR1 G GC^DIM:%ARG=""!%ERR D PARS
|
---|
63 | S %L=":" F %A=%A,%A1 D PARS1 G ER:%ERR!(%A=""&(%C=%L)) S %=%A D ^DIM1
|
---|
64 | I %A1]"" S %=%A1 D ^DIM1
|
---|
65 | G FR1
|
---|
66 | ;
|
---|
67 | PARS S (%A,%C)="" Q:%ERR S (%ERR,%I)=0
|
---|
68 | INC D %INC D QT:%C="""",PARAN:%C="(" Q:%ERR G OUT:","[%C,INC
|
---|
69 | QT D %INC Q:%C="""" G QT:%C]"" S %ERR=1 Q
|
---|
70 | PARAN S %P=1 F %J=0:0 D %INC D QT:%C="""" S %P=%P+$S(%C="(":1,%C=")":-1,1:0) Q:'%P I %C="" S %ERR=1 Q
|
---|
71 | Q
|
---|
72 | OUT S %A=$E(%ARG,1,%I-1),%ARG=$E(%ARG,%I+1,999) Q
|
---|
73 | %INC S %I=%I+1,%C=$E(%ARG,%I) Q
|
---|
74 | ;
|
---|
75 | PARS1 S (%A1,%C)="" Q:%ERR S (%ERR,%I)=0
|
---|
76 | INCR D %INC1 D QT1:%C="""",PARAN1:%C="(" Q:%ERR=1 G OUT1:%L[%C,INCR
|
---|
77 | OUT1 S %A1=$E(%A,%I+1,999),%A=$E(%A,1,%I-1) Q
|
---|
78 | QT1 D %INC1 Q:%C="""" G QT1:%C]"" S %ERR=1 Q
|
---|
79 | PARAN1 S %P=1 F %J=0:0 D %INC1 D QT1:%C="""" S %P=%P+$S(%C="(":1,%C=")":-1,1:0) Q:'%P I %C="" S %ERR=1 Q
|
---|
80 | Q
|
---|
81 | %INC1 S %I=%I+1,%C=$E(%A,%I) Q
|
---|
82 | ;
|
---|
83 | VV ; variable, label, or routine name (LABEL, KL, and FR)
|
---|
84 | I '%ERR,%]"",%'["@",%'?1U.UN,%'?1U.UN1"(".E1")",%'?1"%".UN1"(".E1")",%'?1"%".UN,%'?1"^"1U.UN1"(".E1")",%'?1"^%".UN1"(".E1")",%'?1"^(".E1")",%'?1"^"1U.UN S %ERR=1
|
---|
85 | S:%["?@" %ERR=1 Q
|
---|
86 | ;
|
---|
87 | LNAME(%) ; lname (KL)
|
---|
88 | I %?1(1A,1"%").7UN Q 1
|
---|
89 | I %?1"@".E Q 1
|
---|
90 | Q 0
|
---|
91 | ;
|
---|
92 | ER G ER^DIM
|
---|