home *** CD-ROM | disk | FTP | other *** search
/ Best Objectech Shareware Selections / UNTITLED.iso / boss / word / text / 019 / jed_mail.com < prev    next >
Text File  |  1993-01-19  |  2KB  |  57 lines

  1. $!
  2. $ ! Command procedure to invoke an editor for MAIL.
  3. $ !
  4. $ ! Inputs:
  5. $ !
  6. $ !    P1 = Input file name.
  7. $ !    P2 = Output file name.
  8. $ !
  9. $ ! If MAIL$EDIT is undefined, MAIL will invoke callable EDT.
  10. $ ! If MAIL$EDITis defined to be a command procedure,
  11. $ ! MAIL will create a subprocess to edit the mail.
  12. $ !
  13. $ ! Note that this procedure is run in the context of a subprocess.
  14. $ ! LOGIN.COM is not executed.  However, all process logical names
  15. $ ! and DCL global symbols are copied.
  16. $ !
  17. $ ! The default directory is the same as the parent process
  18. $ !
  19. $!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  20. $!
  21. $! jed:
  22. $!
  23. $!
  24. $!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  25. $!
  26. $!    *** jed ***
  27. $!
  28. $    VERIFY = F$VERIFY (0)
  29. $    define/job/nolog jed_attach_to 'f$getjpi("", "PID")
  30. $    define /user sys$input 'f$trnlnm("SYS$OUTPUT")'
  31. $    if (p1 .EQS. "") THEN GOTO NO_INPUT_jed
  32. $!
  33. $       copy 'p1' 'p2'
  34. $!
  35. $  No_Input_Jed:
  36. $!
  37. $  priv_list       = f$setprv ("NOWORLD, NOGROUP")
  38. $  pid := 'f$trnlnm("JED_PID")'
  39. $  if (pid .eqs. "") then goto no_attach
  40. $  context         = 0
  41. $  Loop:
  42. $     if (pid .eqs. f$pid ( context )) then goto attach
  43. $     if (context .ne. 0) then goto loop
  44. $!
  45. $  no_attach:
  46. $     priv_list       = f$setprv (priv_list)
  47. $     runjed 'p2'
  48. $     goto done
  49. $  attach:
  50. $     priv_list       = f$setprv (priv_list)
  51. $     define/nolog/job jed_file_name "''p2'"
  52. $     attach/id = 'pid'
  53. $ done:
  54. $!
  55. $    IF (VERIFY) THEN SET VERIFY
  56. $    EXIT
  57.