🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.postscript
Article #37

How to modify kshow

#37
From: The Dougster
Date: Wed, 28 Oct 1992 16:19
46 lines
1880 bytes
All of our *show commands need to be intercepted and rewritten.
ashow is now modAShow. show is now modShow. kshow needs to be
modKShow. Here's the dirt:

kshow syntax is

   proc string kshow.

We need to execute kshow a total of four times each time kshow
appears in the postscript stream. The postscript stream comes from
various word processing programs capable of producing postscript,
therefore we don't ever know how large the procedure is, nor what
makes up the string.

We've worked this out so far, and we need to know if there are any
holes in it. (The part in question is determining the size of
the procedure):

---
To make multiple copies of kshow:

1) When kshow is found, count the stack and define C1 = count.

2) Save the stack to disk.

3) Execute kshow.

4) Count the stack again, and define C2 = count.

5) Clear the stack and restore it from disk.

6) C3 = C1 - C2 is the size of the procedure. 

7) copy C3 + 1 items (add one for the string which wasn't
   counted) to the top of the stack, and execute kshow. Repeat
   (7) until the correct number of kshows has been done.
---
This is not elegant, but it should work. Is there an elegant way
to count the number of elements in a kshow procedure? Particularly,
are the braces `{' and `}' placed on the stack as delimiters?

Help.

Douglas                                  DoD#1961  BMWMOA  Renting:N56136
            [Life is for learning.]
Reply-To: gdls!parker@ilium.troy.msen.com
Technical Details
Message-ID: <BwuAoI.AF5@gdls.CSCTMD.COM>
Path: arc1-ca.pugleaf.net!sparky!uunet!ogicse!hp-cv!sdd.hp.com!nigel.msen.com!ilium!gdls!parker

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!ogicse!hp-cv!sdd.hp.com!nigel.msen.com!ilium!gdls!parker
From: parker@gdls.CSCTMD.COM (The Dougster)
Newsgroups: comp.lang.postscript
Subject: How to modify kshow
Message-ID: <BwuAoI.AF5@gdls.CSCTMD.COM>
Date: 28 Oct 92 16:19:29 GMT
Article-I.D.: gdls.BwuAoI.AF5
Distribution: usa
Organization: Computer Sciences Corp. @ General Dynamics
Lines: 46