🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.postscript
Article #4970

Re: defeating save/restore

#4970
From: Frank Jensen
Date: Sun, 10 Mar 1991 18:11
49 lines
1745 bytes
In article <38972@netnews.upenn.edu> jeffe@eniac.seas.upenn.edu (George Jefferson ) writes:

   help..

   I am trying to add a bit of my own postscript code 
   to existing code which wraps each page in a save/restore pair

   My problem is that I would like to pass a value (integer, string whatever)
   from one page to the next..

   %this obviously won't do it.
   save
   .
   .
   /myx 1 def
   .
   restore
   .
   .
   save
   .
   .
   myx 10 10 string cvrs show %for example
   restore


   Is there a way to store a value at some low level which is not
   destroyed by restore?

   I do not want to try to defeat the restore all together, just pass 1 value.

Try:	myx	% load the value of `myx' onto the operand stack
	restore
	exch /myx store	% pop the value on top of the operand stack
			% and store it
	save

Just make sure that the value of `myx' is not a composite object where
some of the components were allocated inside the save/restore pair.
In that case you will get an `invalid restore' error.

   --
   -george            george@mech.seas.upenn.edu

--
Frank Jensen,	fj@iesd.auc.dk
Department of Mathematics and Computer Science
Aalborg University
DENMARK
Technical Details
Message-ID: <FJ.91Mar10181138@indigo.iesd.auc.dk>
Path: arc1-ca.pugleaf.net!utzoo!news-server.csri.toronto.edu!cs.utexas.edu!usc!rpi!uupsi!sunic!dkuug!iesd!iesd.auc.dk!fj
References: <38972@netnews.upenn.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!news-server.csri.toronto.edu!cs.utexas.edu!usc!rpi!uupsi!sunic!dkuug!iesd!iesd.auc.dk!fj
From: fj@iesd.auc.dk (Frank Jensen)
Newsgroups: comp.lang.postscript
Subject: Re: defeating save/restore
Message-ID: <FJ.91Mar10181138@indigo.iesd.auc.dk>
Date: 10 Mar 91 18:11:38 GMT
References: <38972@netnews.upenn.edu>
Sender: news@iesd.auc.dk
Organization: Mathematics and Computer Science, University of Aalborg
Lines: 49
In-reply-to: jeffe@eniac.seas.upenn.edu's message of 8 Mar 91 21:50:52 GMT