home *** CD-ROM | disk | FTP | other *** search
/ Corel Draw 6 / corel-draw-6-cd1.iso / draw / ehandler / ehandler.ps next >
Text File  |  1995-08-18  |  3KB  |  74 lines

  1. %!PS-Adobe-2.0%ehandler.ps -- Downloaded Error Break-page handler
  2. % Copyright (c) 1984, 1985, 1986 Adobe Systems Incorporated.
  3. % All Rights Reserved.
  4. 0000     %exitserver password
  5. /$brkpage where
  6. {pop pop(Error Handler in place - not loaded again\n)print flush
  7.  stop}  %aborts to end-of-job.
  8. {dup serverdict begin statusdict begin checkpassword
  9.  {(Error Handler downloaded.\n)print flush exitserver}
  10.  {pop(Bad Password on loading error handler!!!\n)print flush stop}ifelse
  11. }ifelse
  12.  
  13. /$brkpage 64 dict def $brkpage begin
  14. /prnt
  15.  {dup type/stringtype ne{=string cvs}if dup length 6 mul
  16.   /tx exch def/ty 10 def
  17.   currentpoint/toy exch def/tox exch def 1 setgray newpath
  18.   tox toy 2 sub moveto 0 ty rlineto tx 0 rlineto 0 ty neg rlineto
  19.   closepath fill tox toy moveto 0 setgray show}bind def
  20. /nl{currentpoint exch pop lmargin exch moveto 0 -10 rmoveto}def
  21. /=={/cp 0 def typeprint nl}def
  22. /typeprint{dup type dup currentdict exch known
  23.   {exec}{unknowntype}ifelse}readonly def
  24. /lmargin 72 def
  25. /rmargin 72 def
  26. /tprint
  27.  {dup length cp add rmargin gt{nl/cp 0 def}if
  28.   dup length cp add/cp exch def prnt}readonly def
  29. /cvsprint{=string cvs tprint( )tprint}readonly def
  30. /unknowntype{exch pop cvlit(??)tprint cvsprint}readonly def
  31. /integertype{cvsprint}readonly def
  32. /realtype{cvsprint}readonly def
  33. /booleantype{cvsprint}readonly def
  34. /operatortype{(//)tprint cvsprint}readonly def
  35. /marktype{pop(-mark- )tprint}readonly def
  36. /dicttype{pop(-dictionary- )tprint}readonly def
  37. /nulltype{pop(-null- )tprint}readonly def
  38. /filetype{pop(-filestream- )tprint}readonly def
  39. /savetype{pop(-savelevel- )tprint}readonly def
  40. /fonttype{pop(-fontid- )tprint}readonly def
  41. /nametype{dup xcheck not{(/)tprint}if cvsprint}readonly def
  42. /stringtype
  43.  {dup rcheck{(\()tprint tprint(\))tprint}{pop(-string- )tprint}ifelse
  44.  }readonly def
  45. /arraytype
  46.  {dup rcheck{dup xcheck
  47.   {({)tprint{typeprint}forall(})tprint}
  48.   {([)tprint{typeprint}forall(])tprint}ifelse}{pop(-array- )tprint}ifelse
  49.  }readonly def
  50. /packedarraytype
  51.  {dup rcheck{dup xcheck
  52.   {({)tprint{typeprint}forall(})tprint}
  53.   {([)tprint{typeprint}forall(])tprint}ifelse}{pop(-packedarray- )tprint}
  54.   ifelse
  55.  }readonly def
  56. /courier/Courier findfont 10 scalefont def
  57. /OLDhandleerror errordict /handleerror get def 
  58. end %$brkpage 
  59. /handleerror
  60.  {systemdict begin $error begin $brkpage begin newerror
  61.    {/newerror false store
  62.     vmstatus pop pop 0 ne{grestoreall}if initgraphics courier setfont
  63.     lmargin 720 moveto(ERROR: )prnt errorname prnt
  64.     nl(OFFENDING COMMAND: )prnt/command load prnt
  65.     $error/ostack
  66.     known
  67.       {nl nl(STACK:)prnt nl nl $error/ostack get aload length{==}repeat}if
  68.     systemdict/showpage get exec
  69.     /newerror true store/OLDhandleerror load end end end exec}{end end end}
  70.   ifelse}
  71. dup 0 systemdict put 
  72. dup 4 $brkpage put 
  73. bind readonly errordict 3 1 roll put
  74.