I am getting the following error from gsview: Unrecoverable error: dictstackunderflow in end

In respnce to the following programming statement:
/cirtextdict 16 dict def
cirtextdict begin
     /findhalfangle
          {stringwidth pop 2 div
          2 radius mul pi mul div 360 mul
}def
This is straight out of the Bluebook. I am obviously new to ps programming, so what am I missing here?

Wiz,
I'd be happy to help you solve the problem you are experiencing as you learn the PostScript language.
The chance of a typo is too great for me to accurately and quickly determine what your next step should be in correcting the code.
Can't you attach the code as a text file to your next post so that I can debug exactly what you are working with?
Cut and paste also works for me... not sure why it doesn't work for you.
There are a couple of things I saw in your code that don't make sense to me, but again, it may be the result of typos on your post and not in your working code.
1.)     In your outsideplacechar procedure the following code appears to be missing the rotate command after the "-90".
          "-90 char stringwidth pop 2 div neg 0 moveto char show"
          The rotate command will remove the -90 from the operand stack after rotating about the current position.
2.)     It appears that the code is defining a dictionary, then placing it on top of the dict stack, then storing procedures in it, that in turn, place
          the same dictionary on the dict stack again and then off again each time they are called. Unfortunately, unless the dictionary is on the dict stack the
          procedures in it can't be called. If you remove the dictionary begin and end that surround your individual procedures, along with fixing item 1
          above, then the code will distill/display.
3.)     When the section of code begins that actually draws something, the default setgray value is 0 (black).
          The code changes the origin (0, 0) to be in the middle of an 8-1/2 x 11 inch page.
          Then the scaling is changed to 200% (proportionately), a circle is drawn and filled with black.
          Next the setgray value is changed to 1 (white).
          A smaller circle is drawn concentric to the first and filled with white.
4.)      I expect that you are missing the code to change the setgray value to 1 (black) before attempting to set the two text strings.
5.)      Lastly, based on the results after making corrections I have suggested, The insidecircletext procedure appears to need to rotate by 180 degrees and
          possibly the radius needs to be increased, if both text strings are to appear as though they are set in the same "band" of a circle.
          Not having seen what the end result is supposed to look like I can only guess and so the code I pasted below doesn't reflect a change in radius.
Altered PostScript code:
%%PS
/font {findfont exch scalefont setfont} bind def
/circtextdict 16 dict def
/findhalfangle {stringwidth pop 2 div 2 xradius mul pi mul div 360 mul}def
/outsidecircletext  {
circtextdict begin
/radius exch def
  /centerangle exch def
  /ptsize exch def
  /str exch def
  /xradius radius ptsize 4 div add def
  gsave
   centerangle str findhalfangle add rotate
  str {
  /charcode exch def
  ( ) dup 0 charcode put outsideplacechar
   }forall
grestore
end
}def
/outsideplacechar {
/char exch def
  /halfangle char findhalfangle def
  gsave
   halfangle neg rotate
   radius 0 translate
   -90 rotate char stringwidth pop 2 div neg 0 moveto char show
  grestore
  halfangle 2 mul neg rotate
}def
/insidecircletext {
circtextdict begin
/radius exch def
/centerangle exch def
   /ptsize exch def
/str exch def
/xradius radius ptsize 3 div sub def
gsave
180 rotate
centerangle str findhalfangle sub rotate
str {
  /charcode exch def
      ( ) dup 0 charcode put insideplacechar
}forall
grestore
end
}def
/insideplacechar {
/char exch def
/halfangle char findhalfangle def
gsave
halfangle rotate
radius 0 translate
90 rotate char stringwidth pop 2 div neg 0 moveto char show
grestore
halfangle 2 mul rotate
}def
/pi 3.1415923 def
306 396 translate
2 2 scale
0 0 140 0 360 arc fill
1 setgray
0 0 119 0 360 arc fill
0 setgray
16
/Times-Bold font
(Cracked Recording Studios)
16 90 60 outsidecircletext
14
/Times-Bold font
(Professor's Picks - Vol I)
16 90 60 insidecircletext
showpage

Similar Messages

Maybe you are looking for

  • Apps wont open after update

    Hi, My apps will not open on my iphone 4 after doing the io6 update today. Have tried getting new apps and rebooting, any ideas anyone.

  • Watchpoints: hardware or software

    Hello, I have a question about the implementation of watchpoints in Solaris. This blog: http://blogs.sun.com/eschrock/date/20040713 suggests that watchpoints in Solaris 10 are implemented in software. This article http://developers.sun.com/solaris/ar

  • After the dreaded balck screen w/ pwr symbol my user accout is gone but...

    Wow I finally got to a block to type in! I have no idea if I am in the right place but here goes: I got the dreaded black screen with the white power button symbol. Started up from original system disk only to find that I was no longer around. "User"

  • Is my iphone 5 unlocked? Pic inside

    Is this iphone unlocked? I bought it in Mexico http://i43.tinypic.com/ao6mp4.jpg Thank you.

  • Open Directory Password Permissions

    I was wondering if anyone can shed any light or recommend how I can do this, but basically I have an Xserve running in a mixed Mac/Windows environment (mainly XP but 1 or 2 Vista machines). The clients are not bound to the OD, though each user has a