rlb@rtpark.rtp.ge.com.UUCP (02/04/87)
$! MAIL$EDIT command procedure -- see comments at end $ edit = "EDIT/TPU/SECTION=SYS$SHARE:EVEPLUS.GBL" $ define/process tpuini login_dir:mailtpuini.tpu ! my private tpu ini file $ if f$TRNLNM("kept_edit","lnm$job").nes."" then $ goto ATTACH $NO_KEPT: $ DEFINE /USER SYS$INPUT 'F$TRNLNM("SYS$OUTPUT")' $ IF P1 .EQS. "" THEN GOTO NOINPUT $ EDIT /OUTPUT='P2' 'P1' $ EXIT $NOINPUT: $ EDIT 'P2' $ EXIT $ATTACH: $ priv_list = f$SETPRV("NOWORLD,NOGROUP") $ pid = 0 $ edit_name = f$TRNLNM("kept_edit","lnm$job") $10$: $ process = f$GETJPI(f$PID(pid),"prcnam") $ if process.eqs.edit_name then $ goto DO_ATTACH $ if pid.ne.0 then $ goto 10$ $ goto NO_KEPT $DO_ATTACH: $ define/job mail_sub 'f$GETJPI("","PRCNAM")/nolog $ define/job mail_tmp 'p2'/nolog $ priv_list = f$SETPRV(priv_list) $ write sys$error "[Attaching to Kept Editor]" $ write sys$error "Get File MAIL_TMP to edit" $ write sys$error "Attach to ",f$GETJPI("","PRCNAM")," pid=",- f$GETJPI("","PID")," to send the message" $ wait 0:0:2 $ define/nolog/exec sys$input sys$command: $ define/nolog sys$input sys$command: $ attach "''edit_name'" $ deassign/job mail_sub $ deassign/job mail_tmp $ exit $ ! $ ! Command procedure to invoke an editor for MAIL. $ ! $ ! Inputs: $ ! $ ! P1 = Input file name. $ ! P2 = Output file name. $ ! $ ! If MAIL$EDIT is undefined, MAIL will invoke callable EDT. $ ! If MAIL$EDITis defined to be a command procedure, $ ! MAIL will create a subprocess to edit the mail. $ ! $ ! Note that this procedure is run in the context of a subprocess. $ ! LOGIN.COM is not executed. However, all process logical names $ ! and DCL global symbols are copied. $ ! $ ! The default directory is the same as the parent process $ !