source: FOIAVistA/trunk/r/VA_FILEMAN-ARJT-DI-DD-DM-DT-%DT-%RCR/DIM.m@ 677

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

initial load of FOIAVistA 6/30/08 version

File size: 1.8 KB
Line 
1DIM ;SFISC/JFW,GFT,TOAD-FileMan: M Syntax Checker, Main ;5/6/97 08:34
2 ;;22.0;VA FileMan;;Mar 30, 1999
3 ;Per VHA Directive 10-93-142, this routine should not be modified.
4 ;12275;2236006;1898;
5 ;
6 S %X=X,%END="",%ERR=0,%LAST="" G ER:X'?.ANP
7 ;
8GC ; get next command on line (*)
9 G ER:%ERR,LAST:";"[$E(%X),ER:"BCDEFGHIKLMNOQRSUWXZ"'[$E(%X)
10 S %LAST=%X D SEP G ER:%ERR S %COM=$P(%ARG,":") ; command word
11 I $L(%COM)>1 D G ER:%ERR
12 . I $T(COMMAND)'[(";"_%COM_";"),%COM'?1"Z"1.U S %ERR=1
13 . E S %COM=$E(%COM)
14 S %=$P(%ARG,":",2,99),%COM(1)=% I %ARG[":",%="" G ER ; command postcond
15 I %]"" D ^DIM1 G ER:%ERR
16 D SEP G ER:%ERR I %ARG="","CDGMORSUWXZ"[%COM G ER ; argument list
17 S %END=%ARG G @%COM
18 ;
19B G GC:%ARG=""&(%COM(1)=""),BK^DIM4
20C G CL^DIM4
21D G DG^DIM3
22E G GC:%ARG=""&(%COM(1)=""),ER
23F G ER:%COM(1)]"",GC:%ARG="",FR^DIM3
24G G DG^DIM3
25H G GC:%ARG=""&(%COM(1)="")&(%X]""),HN^DIM3:%ARG]"",ER Q
26I G ER:%COM(1)]"",IX^DIM4
27K G GC:%ARG=""&(%COM(1)="")&(%X]""),KL^DIM3:%ARG]"",ER
28L G LK^DIM3
29M G S
30N G ER:%ARG=""&(%X=""),K
31O G OP^DIM3
32Q G ER:%ARG]"",GC:%ARG=""&(%COM(1)=""),BK^DIM4
33R G RD^DIM4
34S G ST^DIM4
35U G OP^DIM3
36W G WR^DIM4
37X G IX^DIM4
38Z G GC
39 ;
40SEP ; remove first " "-piece of %X into %ARG: parse commands (GC)
41 F %I=1:1 S %C=$E(%X,%I) D:%C="""" Q:" "[%C
42 . N %OUT S %OUT=0 F D Q:%OUT!%ERR
43 . . S %I=%I+1,%C=$E(%X,%I) I %C="" S %ERR=1 Q
44 . . Q:%C'="""" S %I=%I+1,%C=$E(%X,%I) Q:%C="""" S %OUT=1
45 S %ARG=$E(%X,1,%I-1),%I=%I+1,%X=$E(%X,%I,999)
46 Q
47 ;
48COMMAND ;;BREAK;CLOSE;DO;ELSE;FOR;GOTO;HALT;HANG;IF;KILL;LOCK;MERGE;NEW;OPEN;QUIT;READ;SET;USE;WRITE;XECUTE;
49 ;
50LAST ; check to ensure no trailing "," or " " at end of command (GC)
51 S %L=$L(%LAST),$E(%LAST,%L+1-$L(%X),%L)=""
52 I $E(%END,$L(%END))="," G ER
53 I $E(%X)="",$E(%LAST,%L)=" " G ER
54 G END
55 ;
56ER K X
57END K %,%A,%A1,%A2,%ARG,%C1,%C,%COM,%END,%ERR,%H,%I,%L,%LAST,%P,%X,%Z Q
Note: See TracBrowser for help on using the repository browser.