Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ucbvax!decwrl!adobe!jeynes From: jeynes@adobe.COM (Ross A. Jeynes) Newsgroups: comp.lang.postscript Subject: Re: best method of commenting out blocks of postscript? Keywords: comment blocks Message-ID: <1930@adobe.UUCP> Date: 5 Mar 90 22:57:19 GMT References: <22649@pasteur.Berkeley.EDU> Reply-To: jeynes@adobe.UUCP (Ross A. Jeynes) Distribution: usa Organization: Adobe Systems Incorporated, Mountain View Lines: 93 In article <22649@pasteur.Berkeley.EDU> seth@miro.Berkeley.EDU (Seth Teller) writes: >will someone please mail me the results of the discussion a while back >as to the best way of commenting out blocks of postscript code? i have >much huge postscript output and would like to avoid putting %'s >everywhere. I pulled this tidbit off the net a while ago; is this what you're trying to do? --------------- From decwrl!sun-barr!cs.utexas.edu!uunet!mcvax!kth!draken!tut!santra!kampi.hut.fi!alo Tue Jun 6 17:31:44 PDT 1989 Article 1202 of comp.lang.postscript: Path: adobe!decwrl!sun-barr!cs.utexas.edu!uunet!mcvax!kth!draken!tut!santra!kampi.hut.fi!alo >From: alo@kampi.hut.fi (Antti Louko) Newsgroups: comp.lang.postscript Subject: Re: The // operator Message-ID: <22580@santra.UUCP> Date: 6 Jun 89 07:56:01 GMT References: <3903@imagen.UUCP> Sender: news@santra.UUCP Reply-To: alo@kampi.hut.fi (Antti Louko) Organization: Helsinki University of Technology, Finland [-discussion deleted-] Software developers, you can use this little hack I just put together: skipblock is a procedure which skips a %%BeginProcSet .. %%EndProcSet region so that the interpreter won't scan the skipped text. The only problem is how to get big companies to use this procedure... Antti -------------------------------- %! %%BeginProcSet: skipblock 1.0 0 /stoppedreadline { /savedhandler errordict /rangecheck get def errordict /rangecheck { pop stop } put { readline } stopped errordict /rangecheck /savedhandler load put { exch pop true dup } { false } ifelse } bind def /readlinehead { /-str- exch def /-file- exch def -file- -str- stoppedreadline { { -file- (..............) stoppedreadline not { pop pop exit} if pop pop } loop } if } bind def /skipblock { /-save- save def /str 600 string def /str2 600 string def currentfile str readlinehead not { stop } if (%%BeginProcSet:) anchorsearch { pop /-name- exch def } { stop } ifelse { currentfile str2 readlinehead not { stop } if (%%EndProcSet:) anchorsearch { pop -name- eq { exit } if } { pop } ifelse } loop -save- restore } bind def %%EndProcSet: skipblock 1.0 0 %example skipblock %%BeginProcSet: foobar (This stuff should be skipped) == (This stuff should be skipped) == (This stuff should be skipped) == (This stuff should be skipped) == %%EndProcSet: foobar (This stuff should not be skipped) == -------------------------------- >From: alo@kampi.hut.fi (Antti Louko) --------------- Ross Jeynes Developer Support jeynes@adobe.com Adobe Systems Incorporated {sun|decwrl}!adobe!jeynes