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

  1. $ verify = f$verify (0)
  2. $!
  3. $!  Kept_Jed.com --- basede on kepteditor.com by Joe Kelsey
  4. $!
  5. $!  Defines the PF1 key to reattach instantly instead of going back
  6. $!  through this file again.
  7. $!
  8. $ name            = "JED " + f$trnlnm ( "TT" ) - ":"
  9. $ priv_list       = f$setprv ("NOWORLD, NOGROUP")
  10. $ context         = 0
  11. $ Loop:
  12. $   pid             = f$pid ( context )
  13. $   proc            = f$getjpi (pid, "PRCNAM")
  14. $   if proc .eqs. name then goto attach
  15. $   if context .ne. 0 then goto Loop
  16. $!
  17. $  args = p1 + " " + p2 + " " + p3 + " " -
  18.      + p4 + " " + p5 + " " + p6 + " " + p7 + " " + p8
  19. $  priv_list = f$setprv ( priv_list )
  20. $  write sys$error  "[Spawning a new Kept JED]"
  21. $  define/user sys$input sys$command
  22. $  spawn/nolog/process="''name'" runjed 'args'
  23. $!
  24. $!  define gold key (PF1) to immediately attach
  25. $!
  26. $ context = 0    
  27. $ gold_loop:
  28. $   pid = f$pid ( context )
  29. $   proc = f$getjpi (pid, "PRCNAM")
  30. $   if proc .eqs. name then goto gold_loop_exit
  31. $   if context .ne. 0 then goto gold_loop
  32. $   goto quit             !could not find jed process so we quit
  33. $!
  34. $ gold_loop_exit:
  35. $   define/key/nolog/terminate/noecho pf1  "attach/ident=''pid'"
  36. $   define/nolog/job JED_PID "''pid'"
  37. $   goto quit
  38. $!
  39. $!
  40. $ attach:
  41. $    priv_list       = f$setprv ( priv_list )
  42. $    message_status = f$environment("message")
  43. $    set noon
  44. $    set message /nofacility/noidentification/noseverity/notext
  45. $    set on
  46. $    set message 'message_status
  47. $    if p1 .eqs. "" then goto no_logical
  48. $    temp = f$trnlnm("SYS$DISK") + f$directory() + p1
  49. $    temp = f$edit(temp,"lowercase")
  50. $    define/nolog/job jed_file_name "''temp'"
  51. $    no_logical:
  52. $    write sys$error "[Attaching to process ''NAME']"
  53. $    define/user sys$input sys$command
  54. $    attach "''NAME'"
  55. $!
  56. $ quit:
  57. $!
  58. $    message_status = f$environment("message")
  59. $    set noon
  60. $    set message /nofacility/noidentification/noseverity/notext
  61. $    deassign/job jed_file_name
  62. $    set on
  63. $    set message 'message_status
  64. $    write sys$error -
  65.        "[Attached to DCL in directory ''F$TRNLNM("SYS$DISK")'''F$DIRECTORY()']"
  66. $    if verify then set verify
  67. $    exit
  68.     
  69.