[613] | 1 | XINDX3 ;ISC/REL,GRK,RWF - PROCESS MERGE/SET/READ/KILL/NEW/OPEN COMMANDS ;10/23/2003 17:43
|
---|
| 2 | ;;7.3;TOOLKIT;**20,27,61,68**;Apr 25, 1995
|
---|
| 3 | PEEK S Y=$G(LV(LV,LI+1)) Q
|
---|
| 4 | PEEK2 S Y=$G(LV(LV,LI+2)) Q
|
---|
| 5 | INC2 S LI=LI+1 ;Drop into INC
|
---|
| 6 | INC S LI=LI+1,S=$G(LV(LV,LI)),S1=$G(LV(LV,LI+1)),CH=$E(S) G ERR:$A(S)=10 Q
|
---|
| 7 | DN S LI(LV)=LI,LI(LV,1)=AC,LV=LV+1,LI=LI(LV),AC=NOA
|
---|
| 8 | Q
|
---|
| 9 | UP ;Inc LI as we save to skip the $C(10).
|
---|
| 10 | D PEEK S:$A(Y)=10 LI=LI+1 S LI(LV)=LI,LV=LV-1,LI=LI(LV),AC=LI(LV,1) Q
|
---|
| 11 | PEEKDN S Y=$G(LV(LV+1,LI(LV+1)+1)) Q
|
---|
| 12 | FIND F Y=LI:1:AC Q:L[$G(LV(LV,Y))
|
---|
| 13 | ERR D E^XINDX1(43) S (S,S1,CH)="" Q
|
---|
| 14 | Q
|
---|
| 15 | Q
|
---|
| 16 | S S ERR=10 G:ARG="" ^XINDX1 S STR=ARG,ARG="",RHS=0 D ^XINDX9
|
---|
| 17 | S2 S GK="" D INC I S="" D:'RHS E^XINDX1(10) Q
|
---|
| 18 | I CH="," S RHS=0 G S2
|
---|
| 19 | I CH="=" S RHS=1 D:","[S1 E^XINDX1(10) G S2
|
---|
| 20 | I CH="$",'RHS D D:% E^XINDX1(10)
|
---|
| 21 | . S %=1
|
---|
| 22 | . I "$E$P$X$Y"[$E(S,1,2) S %=0 Q
|
---|
| 23 | . I "$EC$ET$QS"[$E(S,1,3) S %=0 Q
|
---|
| 24 | . I "$ZE$ZT"[$E(S,1,3) D E^XINDX1(28) S %=0 Q ;Should not be used
|
---|
| 25 | . Q
|
---|
| 26 | I CH="^" D FL G S2
|
---|
| 27 | I CH="@" S Y=$$ASM(LV,LI,",") S:Y'["=" RHS=1 D INC,ARG^XINDX2 G S2
|
---|
| 28 | I CH="(" D MULT G S2
|
---|
| 29 | D FL G S2
|
---|
| 30 | MULT D INC S NOA=S I S'>0 S ERR=5 G ^XINDX1
|
---|
| 31 | D DN S AC=AC+LI F Q:AC'>LI S:'RHS GK="*" D INC,ARG^XINDX2
|
---|
| 32 | D UP Q
|
---|
| 33 | FL ;
|
---|
| 34 | S:'RHS GK="*" D ARG^XINDX2
|
---|
| 35 | Q
|
---|
| 36 | VLNF(X) ;Drop into VLN
|
---|
| 37 | VLN S ERR=0
|
---|
| 38 | Q:X?1.8UN
|
---|
| 39 | Q:X?1"%".7UN
|
---|
| 40 | I X'?1.8AN,X'?1"%".7AN D E^XINDX1(11)
|
---|
| 41 | D E^XINDX1(57) ;Must contain lowercase
|
---|
| 42 | ;I X'?1.8UN,X'?1.8LN,X'?1"%".7UN,X'?1"%".7LN D E^XINDX1(ERR)
|
---|
| 43 | Q
|
---|
| 44 | VGN S ERR=0 I X'?1.8UN,X'?1"%".7UN D E^XINDX1(12)
|
---|
| 45 | Q
|
---|
| 46 | KL ;Process KILL
|
---|
| 47 | S STR=ARG,ARG(1)=ARG,ARG="" D ^XINDX9
|
---|
| 48 | A D INC Q:S="" G A:CH="," S LOC="L" D @$S(CH="@":"KL1",CH="^":"KL2",CH="(":"KL4",1:"KL3") G A
|
---|
| 49 | KL1 D INC,ARG^XINDX2 Q
|
---|
| 50 | KL2 S GK="!"
|
---|
| 51 | I S1'="(" S ERR=24 D ^XINDX1
|
---|
| 52 | G ARG^XINDX2
|
---|
| 53 | KL3 I "^DT^DTIME^DUZ^IOST^IOM^U^"[("^"_S_"^") S ERR=39,ERR(1)=S D ^XINDX1
|
---|
| 54 | I "IO"=S D:S1="(" PEEKDN S ERR=39,ERR(1)=S_$S(S1["(":S1_Y_")",1:"") D:S1'="(" ^XINDX1 I S1="(",("QC"'[$E(Y,2)) D ^XINDX1
|
---|
| 55 | KL5 S GK="!" D ARG^XINDX2 Q ;KILL SUBS
|
---|
| 56 | Q
|
---|
| 57 | KL4 S NOA=S1 D DN,ARGS^XINDX2,UP,INC2 Q
|
---|
| 58 | NE ;NEW
|
---|
| 59 | S ERR=$S("("[$E(ARG):26,1:0) I ERR G ^XINDX1 ;look for null or (
|
---|
| 60 | S STR=ARG D ^XINDX9
|
---|
| 61 | N2 D INC Q:S="" G N2:CH="," I CH?1P,("%@()"'[CH)&("$E"'[$E(S,1,2)) D E^XINDX1(11) G N2
|
---|
| 62 | S GK="~" D ARG^XINDX2 G N2
|
---|
| 63 | ;
|
---|
| 64 | RD S STR=ARG D ^XINDX9 S ARG=""
|
---|
| 65 | RD1 D INC Q:S=""
|
---|
| 66 | ;I (CH="!")!(CH=",")!(CH=Q)!(CH="#") G RD1
|
---|
| 67 | ;I CH="^" S ERR=11 D ^XINDX1
|
---|
| 68 | I '((CH="%")!(CH?1A)!(CH="*")) D RD3 G RD1
|
---|
| 69 | S Y=$$ASM(LV,LI,",") I Y'[":" S ERR=33,RDTIME=1 D ^XINDX1
|
---|
| 70 | D RD2 G RD1
|
---|
| 71 | RD2 Q:","[CH
|
---|
| 72 | I "*#"[CH D E^XINDX1(41)
|
---|
| 73 | I "#:"[CH D INC,ARG^XINDX2,INC G RD2
|
---|
| 74 | I (CH="%")!(CH?1A) S LOC="L",GK="*" D ARG^XINDX2,INC G RD2
|
---|
| 75 | D INC G RD2
|
---|
| 76 | RD3 Q:","[CH I "!#?"[CH D INC G RD3
|
---|
| 77 | I (CH="%")!(CH?1A)!(CH="@") D ARG^XINDX2,INC G RD3
|
---|
| 78 | Q
|
---|
| 79 | O S STR=ARG,AC=99 D ^XINDX9,INC S ARG="" I S["@" D ARGS^XINDX2 Q
|
---|
| 80 | D ARG^XINDX2,INC D D INC,ARGS^XINDX2 Q
|
---|
| 81 | . F D INC Q:":"[S
|
---|
| 82 | . Q
|
---|
| 83 | Q
|
---|
| 84 | ERRCP S ERR=5 D ^XINDX1 Q
|
---|
| 85 | ST ;
|
---|
| 86 | S:'$D(V(LOC,S)) V(LOC,S)="" S:V(LOC,S)'[GK V(LOC,S)=V(LOC,S)_GK,GK="" Q
|
---|
| 87 | Q
|
---|
| 88 | ASM(WL,SI,L,SEP) ;
|
---|
| 89 | N %,CH,Y S SEP=$G(SEP),Y="" F %=SI:1 S CH=$G(LV(WL,%)) Q:L[CH S Y=Y_SEP_CH
|
---|
| 90 | Q Y
|
---|