Path: 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: <1990Nov2.143417.3146@ohrd.uucp> Reply-To: glenn@heaven.woodside.ca.us (Glenn Reid) Distribution: comp Organization: RightBrain Software, Woodside, CA Lines: 28 In article 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