XMXTO ;ISC-SF/GMB-Address a msg ;08/08/2000  14:38
 ;;8.0;MailMan;;Jun 28, 2002
 ; Entry points:
 ; ITOWHOM  Interactive 'to whom:'
 ; TOWHOM   Silent 'to whom:'
ITOWHOM(XMDUZ,XMZ,XMTYPE,XMINSTR) ; Interactive
 ; XMDUZ             DUZ of who is sending or forwarding the message
 ; XMZ               The message number
 ;                   (need not be supplied if XMTYPE="S" and
 ;                   XMINSTR("ADDR FLAGS")["R")
 ; XMTYPE            S='Send to:'
 ;                   F='Forward to:'
 ; XMINSTR("SELF BSKT") Basket to deliver to if sender is recipient
 ; XMINSTR("SHARE DATE") Delete date if recipient is "SHARED,MAIL"
 ; XMINSTR("SHARE BSKT") Basket if recipient is "SHARED,MAIL"
 ; XMINSTR("TO PROMPT") Initial prompt to whom to send the message (default=XMDUZ)
 ; XMINSTR("FLAGS")  Any or all or none of the following:
 ;                   (Necessary only if XMTYPE="S" and XMINSTR("ADDR FLAGS")["R")
 ;                   X Closed msg (may not be forwarded)
 ;                   C Confidential msg (surrogates may not read)
 ; XMINSTR("ADDR FLAGS")   Any or all of the following:
 ;                   I Do not Initialize (kill) the ^TMP addressee global
 ;                   R Do not Restrict addressees
 N XMRESTR,XMABORT
 K XMERR,^TMP("XMERR",$J)
 D INIT(XMDUZ,.XMZ,XMTYPE,.XMINSTR,.XMRESTR,.XMPROMPT) Q:$D(XMERR)
 S XMABORT=0
 D TOWHOM^XMJMT(XMDUZ,XMPROMPT,.XMINSTR,.XMRESTR,.XMABORT)
 Q:'XMABORT
 D ERRSET^XMXUTIL($S(XMABORT=1:37000,1:37001)) ; up-arrow out. / time out.
 Q
TOWHOM(XMDUZ,XMZ,XMTYPE,XMTO,XMINSTR,XMFULL) ; Silent
 ; XMDUZ       (in)  DUZ of who is sending or forwarding the message
 ; XMZ         (in)  The message number
 ;                   (need not be supplied if XMTYPE="S" and
 ;                   XMINSTR("ADDR FLAGS")["R")
 ; XMTYPE      (in)  S='Send to:'
 ;                   F='Forward to:'
 ; XMTO        (in)  ONE addressee
 ; XMINSTR("SELF BSKT")  (in) Basket to deliver to if sender is recipient
 ; XMINSTR("SHARE DATE") (in) Delete date if recipient is "SHARED,MAIL"
 ; XMINSTR("SHARE BSKT") (in) Basket if recipient is "SHARED,MAIL"
 ; XMINSTR("FLAGS")      (in) Any or all or none of the following:
 ;                   (Necessary only if XMTYPE="S" and XMINSTR("ADDR FLAGS")["R")
 ;                   X Closed msg (may not be forwarded)
 ;                   C Confidential msg (surrogates may not read)
 ; XMINSTR("ADDR FLAGS")   Any or all of the following:
 ;                   I Do not Initialize (kill) the ^TMP addressee global
 ;                   R Do not Restrict addressees
 ; XMFULL      (out) the full address
 N XMRESTR
 K XMERR,^TMP("XMERR",$J)
 D INIT(XMDUZ,.XMZ,XMTYPE,.XMINSTR,.XMRESTR) Q:$D(XMERR)
 D CHKADDR^XMXADDR(XMDUZ,.XMTO,.XMINSTR,.XMRESTR,.XMFULL)
 Q
INIT(XMDUZ,XMZ,XMTYPE,XMINSTR,XMRESTR,XMPROMPT) ;
 I XMTYPE="S" D
 . S XMPROMPT=$$EZBLD^DIALOG(34110) ; Send
 . D:$G(XMINSTR("ADDR FLAGS"))'["R" CHKLINES^XMXSEC1(XMDUZ,XMZ,.XMRESTR)
 E  D
 . N XMZREC
 . S XMZREC=^XMB(3.9,XMZ,0)
 . S XMPROMPT=$$EZBLD^DIALOG(34111) ; Forward
 . Q:'$$FORWARD^XMXSEC(XMDUZ,XMZ,XMZREC)
 . D:$G(XMINSTR("ADDR FLAGS"))'["R" GETRESTR^XMXSEC1(XMDUZ,XMZ,XMZREC,.XMINSTR,.XMRESTR)
 D:$G(XMINSTR("ADDR FLAGS"))'["I" INIT^XMXADDR
 Q
 
--- Routine Detail   --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HXMXTO   3253     printed  Sep 23, 2025@19:50:28                                                                                                                                                                                                       Page 2
XMXTO     ;ISC-SF/GMB-Address a msg ;08/08/2000  14:38
 +1       ;;8.0;MailMan;;Jun 28, 2002
 +2       ; Entry points:
 +3       ; ITOWHOM  Interactive 'to whom:'
 +4       ; TOWHOM   Silent 'to whom:'
ITOWHOM(XMDUZ,XMZ,XMTYPE,XMINSTR) ; Interactive
 +1       ; XMDUZ             DUZ of who is sending or forwarding the message
 +2       ; XMZ               The message number
 +3       ;                   (need not be supplied if XMTYPE="S" and
 +4       ;                   XMINSTR("ADDR FLAGS")["R")
 +5       ; XMTYPE            S='Send to:'
 +6       ;                   F='Forward to:'
 +7       ; XMINSTR("SELF BSKT") Basket to deliver to if sender is recipient
 +8       ; XMINSTR("SHARE DATE") Delete date if recipient is "SHARED,MAIL"
 +9       ; XMINSTR("SHARE BSKT") Basket if recipient is "SHARED,MAIL"
 +10      ; XMINSTR("TO PROMPT") Initial prompt to whom to send the message (default=XMDUZ)
 +11      ; XMINSTR("FLAGS")  Any or all or none of the following:
 +12      ;                   (Necessary only if XMTYPE="S" and XMINSTR("ADDR FLAGS")["R")
 +13      ;                   X Closed msg (may not be forwarded)
 +14      ;                   C Confidential msg (surrogates may not read)
 +15      ; XMINSTR("ADDR FLAGS")   Any or all of the following:
 +16      ;                   I Do not Initialize (kill) the ^TMP addressee global
 +17      ;                   R Do not Restrict addressees
 +18       NEW XMRESTR,XMABORT
 +19       KILL XMERR,^TMP("XMERR",$JOB)
 +20       DO INIT(XMDUZ,.XMZ,XMTYPE,.XMINSTR,.XMRESTR,.XMPROMPT)
           if $DATA(XMERR)
               QUIT 
 +21       SET XMABORT=0
 +22       DO TOWHOM^XMJMT(XMDUZ,XMPROMPT,.XMINSTR,.XMRESTR,.XMABORT)
 +23       if 'XMABORT
               QUIT 
 +24      ; up-arrow out. / time out.
           DO ERRSET^XMXUTIL($SELECT(XMABORT=1:37000,1:37001))
 +25       QUIT 
TOWHOM(XMDUZ,XMZ,XMTYPE,XMTO,XMINSTR,XMFULL) ; Silent
 +1       ; XMDUZ       (in)  DUZ of who is sending or forwarding the message
 +2       ; XMZ         (in)  The message number
 +3       ;                   (need not be supplied if XMTYPE="S" and
 +4       ;                   XMINSTR("ADDR FLAGS")["R")
 +5       ; XMTYPE      (in)  S='Send to:'
 +6       ;                   F='Forward to:'
 +7       ; XMTO        (in)  ONE addressee
 +8       ; XMINSTR("SELF BSKT")  (in) Basket to deliver to if sender is recipient
 +9       ; XMINSTR("SHARE DATE") (in) Delete date if recipient is "SHARED,MAIL"
 +10      ; XMINSTR("SHARE BSKT") (in) Basket if recipient is "SHARED,MAIL"
 +11      ; XMINSTR("FLAGS")      (in) Any or all or none of the following:
 +12      ;                   (Necessary only if XMTYPE="S" and XMINSTR("ADDR FLAGS")["R")
 +13      ;                   X Closed msg (may not be forwarded)
 +14      ;                   C Confidential msg (surrogates may not read)
 +15      ; XMINSTR("ADDR FLAGS")   Any or all of the following:
 +16      ;                   I Do not Initialize (kill) the ^TMP addressee global
 +17      ;                   R Do not Restrict addressees
 +18      ; XMFULL      (out) the full address
 +19       NEW XMRESTR
 +20       KILL XMERR,^TMP("XMERR",$JOB)
 +21       DO INIT(XMDUZ,.XMZ,XMTYPE,.XMINSTR,.XMRESTR)
           if $DATA(XMERR)
               QUIT 
 +22       DO CHKADDR^XMXADDR(XMDUZ,.XMTO,.XMINSTR,.XMRESTR,.XMFULL)
 +23       QUIT 
INIT(XMDUZ,XMZ,XMTYPE,XMINSTR,XMRESTR,XMPROMPT) ;
 +1        IF XMTYPE="S"
               Begin DoDot:1
 +2       ; Send
                   SET XMPROMPT=$$EZBLD^DIALOG(34110)
 +3                if $GET(XMINSTR("ADDR FLAGS"))'["R"
                       DO CHKLINES^XMXSEC1(XMDUZ,XMZ,.XMRESTR)
               End DoDot:1
 +4       IF '$TEST
               Begin DoDot:1
 +5                NEW XMZREC
 +6                SET XMZREC=^XMB(3.9,XMZ,0)
 +7       ; Forward
                   SET XMPROMPT=$$EZBLD^DIALOG(34111)
 +8                if '$$FORWARD^XMXSEC(XMDUZ,XMZ,XMZREC)
                       QUIT 
 +9                if $GET(XMINSTR("ADDR FLAGS"))'["R"
                       DO GETRESTR^XMXSEC1(XMDUZ,XMZ,XMZREC,.XMINSTR,.XMRESTR)
               End DoDot:1
 +10       if $GET(XMINSTR("ADDR FLAGS"))'["I"
               DO INIT^XMXADDR
 +11       QUIT