Q:

postscript define string variable

I would like to make a variable called units that stores the string "cm". I have tried to do this in the following ways:
1) /units (cm) def
2) /units "cm" def
3) /units cm def
4) /units "cm" string def

here is a program that won't run:
/units (cm) def
0 0 moveto 100 100 lineto

none of which work, how can this be done?
To be more explicit, here is the program I want to create:
/units (cm) def
/Times-Roman findfont 20 scalefont setfont
300 300 moveto units show stroke

A:

This:
/units (cm) def
/Times-Roman findfont 20 scalefont setfont
300 300 moveto units show
showpage

might be what you want

