source: FOIAVistA/trunk/r/MAILMAN-XM/XMC1B.m@ 1720

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

initial load of FOIAVistA 6/30/08 version

File size: 1.9 KB
Line 
1XMC1B ;(WASH ISC)/THM-Script Interpreter (Open/Close) ;06/11/2002 09:33
2 ;;8.0;MailMan;;Jun 28, 2002
3 ; In:
4 ; XMB
5 ; XMC1
6OPEN ;OPEN Command
7 ; O H=FORUM.VA.GOV,P=TCP/IP-MAILMAN
8 N XMI,XMCP,XMCP1,XMCP2
9 F XMI=1:1:$L(XMC1,",") S XMCP=$P(XMC1,",",XMI) D Q:ER
10 . S XMCP1=$P(XMCP,"=",1),XMCP2=$P(XMCP,"=",2)
11 . I XMCP1=$E("HOST",1,$L(XMCP1)) D HOST(XMCP2) Q
12 . I XMCP1=$E("PROTOCOL",1,$L(XMCP1)) D PROT(XMCP2) Q
13 . D ERTRAN^XMC1(42245,XMCP1) ;Invalid parameter: '|1|'
14 Q:ER
15 I $G(XMPROT)="" D PROT("SCP")
16 D DEVICE Q:ER
17 Q
18HOST(X) ; Host - Set IP address used by transmission scripts in file 4.6
19 S XMHOST=$P(XMB("SCR REC"),U,6)
20 I XMHOST="" S XMHOST="NO-IP"
21 Q
22PROT(XMCHAN) ; Communications Protocol
23 N Y
24 D GET^XML
25 Q
26DEVICE ;
27 S XMCP2=$S($D(ZTQUEUED)&$L($G(ZTIO)):ZTIO,$D(ZTQUEUED)&$L($G(ION)):ION,$L($G(XMIO)):XMIO,1:$P(XMB("SCR REC"),U,5))
28 Q:XMCP2=""
29 D TRYDEV(XMCP2) Q:'ER
30 I $G(XMIO)="",$G(XMIO)=$G(ZTIO),$G(XMIO)'=XMCP2 D TRYDEV(XMIO)
31 Q
32TRYDEV(X) ; Device specification parsing
33 S ER=0 I $D(ZTQUEUED),IO'="" U IO D D1 Q
34 I X="" S ER=1 Q
35 S %ZIS="R",IOP=X D ^%ZIS K IOP
36 I POP D ERTRAN^XMC1(42246,X) Q ;Device '|1|' could not be opened by %ZIS.
37 S XMHANG("OPEN")=9
38 D D1
39 Q
40D1 ;
41 S XMC("DEVICE")=$P(^%ZIS(1,IOS,0),U),XMC("MODEM")=$P(^(0),U,6)
42 I $L(XMC("MODEM")),$D(^%ZIS(2,XMC("MODEM"),50)) S XMDIAL=^(50),XMHANG=^(51),XMSTAT=$G(^(52))
43 Q:IOT="RES"
44 U IO X ^%ZOSF("EOFF") S X=255 X ^%ZOSF("RM") X ^%ZOSF("TYPE-AHEAD")
45 Q
46CLOSE ; Close channel
47 I $G(XMHANG)'="" X XMHANG D:$L(IO) FLUSH^XMC1
48 ;|1| sent, |2| received, |3| retransmissions.
49 D DOTRAN^XMC1($S($G(XMTLER):42248,1:42247),+$G(XMC("S")),+$G(XMC("R")),$G(XMTLER))
50 I '$D(ZTQUEUED),$G(XMHANG("OPEN"))=9 D ^%ZISC
51 S IOP="HOME" D ^%ZIS
52 ; Instead of the above line, v7.1 does this: *******************
53 ; I '$D(ZTQUEUED) D HOME^%ZIS
54 ; I $D(ZTQUEUED) S IO("C")=1 D ^%ZISC
55 I $G(XMINST),$D(^XMBS(4.2999,XMINST,3)) S $P(^(3),U,1,6)="^^^^^"
56 Q
Note: See TracBrowser for help on using the repository browser.