home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 June / SIMTEL_0692.cdr / msdos / ventura / psutils.arc / EHANDLER.PS < prev    next >
Encoding:
Text File  |  1987-01-12  |  2.8 KB  |  66 lines

  1. %!
  2.  
  3. % lib/ehandler.ps -- Downloaded Error Break-page handler
  4.  
  5. % Copyright (c) 1984, 1985 Adobe Systems Incorporated. All Rights Reserved.
  6.  
  7. % RCSID: $Header: ehandler.ps,v 2.1 85/11/24 12:20:03 shore Rel $
  8.  
  9. % assumes serverloop password is the default one
  10.  
  11. /$brkpage where
  12.  
  13. {pop(Error Handler in place - not loaded again\n)print flush stop}
  14.  
  15. {serverdict begin statusdict begin 0000 checkpassword
  16.  
  17.  {(Error Handler downloaded.\n)print flush 0000 exitserver}
  18.  
  19.  {(Bad Password on loading error handler!!!\n)print flush stop}ifelse
  20.  
  21. }ifelse
  22.  
  23. /$brkpage 64 dict def $brkpage begin
  24.  
  25. /prnt
  26.  
  27.  {dup type/stringtype ne{=string cvs}if dup length 6 mul/tx exch def/ty 10 def
  28.  
  29.   currentpoint/toy exch def/tox exch def 1 setgray newpath
  30.  
  31.   tox toy 2 sub moveto 0 ty rlineto tx 0 rlineto 0 ty neg rlineto
  32.  
  33.   closepath fill tox toy moveto 0 setgray show}bind def
  34.  
  35. /nl{currentpoint exch pop lmargin exch moveto 0 -10 rmoveto}def
  36.  
  37. /=={/cp 0 def typeprint nl}def
  38.  
  39. /typeprint{dup type exec}readonly def
  40.  
  41. /lmargin 72 def
  42.  
  43. /rmargin 72 def
  44.  
  45. /tprint
  46.  
  47.    {dup length cp add rmargin gt{nl/cp 0 def}if
  48.  
  49.     dup length cp add/cp exch def prnt}readonly def
  50.  
  51. /cvsprint{=string cvs tprint( )tprint}readonly def
  52.  
  53. /integertype{cvsprint}readonly def
  54.  
  55. /realtype{cvsprint}readonly def
  56.  
  57. /booleantype{cvsprint}readonly def
  58.  
  59. /operatortype{(--)tprint =string cvs tprint(-- )tprint}readonly def
  60.  
  61. /marktype{pop(-mark- )tprint}readonly def
  62.  
  63. /dicttype{pop(-dictionary- )tprint}readonly def
  64.  
  65. /nulltype{pop(-null- )tprint}readonly def
  66.  
  67. /filetype{pop(-filestream- )tprint}readonly def
  68.  
  69. /savetype{pop(-savelevel- )tprint}readonly def
  70.  
  71. /fonttype{pop(-fontid- )tprint}readonly def
  72.  
  73. /nametype{dup xcheck not{(/)tprint}if cvsprint}readonly def
  74.  
  75. /stringtype
  76.  
  77.  {dup rcheck{(\()tprint tprint(\))tprint}{pop(-string- )tprint}ifelse
  78.  
  79.  }readonly def
  80.  
  81. /arraytype
  82.  
  83.  {dup rcheck{dup xcheck
  84.  
  85.   {({)tprint{typeprint}forall(})tprint}
  86.  
  87.   {([)tprint{typeprint}forall(])tprint}ifelse}{pop(-array- )tprint}ifelse
  88.  
  89.  }readonly def
  90.  
  91. /packedarraytype
  92.  
  93.  {dup rcheck{dup xcheck
  94.  
  95.   {({)tprint{typeprint}forall(})tprint}
  96.  
  97.   {([)tprint{typeprint}forall(])tprint}ifelse}{pop(-packedarray- )tprint}ifelse
  98.  
  99.  }readonly def
  100.  
  101. /courier/Courier findfont 10 scalefont def
  102.  
  103. end %$brkpage
  104.  
  105. errordict/handleerror
  106.  
  107.  {systemdict begin $error begin $brkpage begin newerror
  108.  
  109.    {/newerror false store 
  110.  
  111.     vmstatus pop pop 0 ne{grestoreall}if initgraphics courier setfont
  112.  
  113.     lmargin 720 moveto(ERROR: )prnt errorname prnt
  114.  
  115.     nl(OFFENDING COMMAND: )prnt/command load prnt
  116.  
  117.     $error/ostack 
  118.  
  119.     known{nl nl(STACK:)prnt nl nl $error/ostack get aload length{==}repeat}if
  120.  
  121.     systemdict/showpage get exec(%%[ Error: )print
  122.  
  123.     errorname =print(; OffendingCommand: )print/command 
  124.  
  125.     load =print( ]%%)= flush}if end end end}
  126.  
  127. dup 0 systemdict put dup 4 $brkpage put bind readonly put
  128.  
  129.  
  130.  
  131.