85 lines
3.7 KiB
Mathematica
85 lines
3.7 KiB
Mathematica
XMXLIST2 ;ISC-SF/GMB-List message: multiple conditions (cont.) ;08/30/2000 11:01
|
|
;;8.0;MailMan;;Jun 28, 2002
|
|
; Look in just one of the user's baskets.
|
|
NEW1(XMDUZ,XMK,XMKN,XMTYPE,XMORDER,XMFLDS,XMAMT,XMSTART,XMF,XMTROOT) ; New messages in 1 basket
|
|
N XMCNT,XMZ
|
|
S XMKN=$P(^XMB(3.7,XMDUZ,2,XMK,0),U,1)
|
|
S XMCNT=0
|
|
S XMZ=$G(XMSTART("XMZ"))
|
|
F S XMZ=$O(^XMB(3.7,XMDUZ,XMTYPE,XMK,XMZ),XMORDER) Q:'XMZ D Q:XMCNT=XMAMT
|
|
. I '$D(^XMB(3.7,XMDUZ,2,XMK,1,XMZ,0)) D ADDITN^XMUT4A(XMDUZ,XMTYPE,XMK,XMZ)
|
|
. I '$D(^XMB(3.9,XMZ,0)) D ZAPIT^XMXMSGS2(XMDUZ,XMK,XMZ) Q
|
|
. I $D(XMF) Q:'$$GOODMSG^XMJMFB(XMDUZ,XMK,XMZ,.XMF)
|
|
. S XMCNT=XMCNT+1
|
|
. S @(XMTROOT_XMCNT_")")=XMZ
|
|
. Q:'$D(XMFLDS)
|
|
. D FIELDS^XMXLIST1(XMDUZ,XMK,XMKN,XMZ,.XMFLDS,XMTROOT,XMCNT)
|
|
. I XMFLDS["SEQN" D KSEQN^XMXLIST1(XMDUZ,XMK,XMZ,.XMFLDS,XMTROOT,XMCNT)
|
|
S XMSTART("XMZ")=XMZ
|
|
S @(XMTROOT_"0)")=XMCNT_U_XMAMT
|
|
; Any more?
|
|
I 'XMZ S @(XMTROOT_"0)")=@(XMTROOT_"0)")_"^0" Q
|
|
I '$O(^XMB(3.7,XMDUZ,XMTYPE,XMK,XMZ),XMORDER) S @(XMTROOT_"0)")=@(XMTROOT_"0)")_"^0" Q
|
|
I '$D(XMF) S @(XMTROOT_"0)")=@(XMTROOT_"0)")_"^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