🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.postscript
Article #3553

Re: concat strings

#3553
From: Glenn Reid
Date: Mon, 05 Nov 1990 08:33
28 lines
1509 bytes
In article <DAVIS.90Oct31164243@pacific.mps.ohio-state.edu> davis@pacific.mps.ohio-state.edu  (John E. Davis) writes:
>Hi,
>
>   What is the easies way I can concatenate two strings of different fonts to
>produce a third string?  I don't care if the two original strings are lost in
>the process-- I only need the result.  An example would be greatly appreciated.

Here's an example string-concatenating procedure that is in my new book,
"Thinking in PostScript" (which I just saw lots of copies of in our local
bookstore!); I'll leave out the error checking code that raises a typecheck
if it isn't passed two strings.

There are lots of ways to do it, naturally, but here's one approach:

/concatenate
{ %def
	dup length 2 index length add string
	dup 0 4 index putinterval
	dup 4 -1 roll length 4 -1 roll putinterval
} bind def


% Glenn

-- 
 Glenn Reid				RightBrain Software
 glenn@heaven.woodside.ca.us		PostScript/NeXT developers
 ..{adobe,next}!heaven!glenn		415-851-1785
Technical Details
Message-ID: <312@heaven.woodside.ca.us>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!cs.utexas.edu!usc!apple!voder!pyramid!decwrl!adobe!heaven!glenn
References: <DAVIS.90Oct31164243@pacific.mps.ohio-state.edu> <1990Nov2.143417.3146@ohrd.uucp>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!cs.utexas.edu!usc!apple!voder!pyramid!decwrl!adobe!heaven!glenn
From: glenn@heaven.woodside.ca.us (Glenn Reid)
Newsgroups: comp.lang.postscript
Subject: Re: concat strings
Message-ID: <312@heaven.woodside.ca.us>
Date: 5 Nov 90 08:33:52 GMT
References: <DAVIS.90Oct31164243@pacific.mps.ohio-state.edu> <1990Nov2.143417.3146@ohrd.uucp>
Reply-To: glenn@heaven.woodside.ca.us (Glenn Reid)
Distribution: comp
Organization: RightBrain Software, Woodside, CA
Lines: 28