Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.postscript > #1250

Re: Filtering problem in GhostScript?

Path csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From Don Lancaster <don@tinaja.com>
Newsgroups comp.lang.postscript
Subject Re: Filtering problem in GhostScript?
Date Sat, 09 Feb 2013 16:22:44 -0700
Lines 43
Message-ID <ano427Foa1dU1@mid.individual.net> (permalink)
References <ano2b2Fntj2U1@mid.individual.net>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Trace individual.net NS40+63uxodH4mcqCkwFIAWQuh86BqoFkAJl04eETL9Q2hULZeXefH5bfxgdwwOs91
Cancel-Lock sha1:5xQyfMXIqIF7FijA0+WrOq+g3zI=
User-Agent Mozilla/5.0 (Windows NT 6.2; WOW64; rv:17.0) Gecko/20130107 Thunderbird/17.0.2
In-Reply-To <ano2b2Fntj2U1@mid.individual.net>
Xref csiph.com comp.lang.postscript:1250

Show key headers only | View raw


On 2/9/2013 3:53 PM, Don Lancaster wrote:
>
> I have long used this super elegant array to string converter in
> PostScript...
>
>     /makestring {dup length string dup    % new string of right size
>            /NullEncode filter             % make a file out of string
>            3 -1 roll
>            {1 index exch write} forall
>            pop
>                } def
>
> Yet it seems to fail in GhostScript, writing all nulls instead.
>
> Does anyone see the problem?
>
>


Yet this slow sledgehammer replacement seems to work just fine...

/makestring1 { /inarray1 exch store
                /outstring1 inarray1 length string store

                0 1 inarray1 length 1 sub {/posn exch store
                inarray1 posn get
                outstring1 exch posn exch put } for

                outstring1 dup length string cvs

              } store




-- 
Many thanks,

Don Lancaster                          voice phone: (928)428-4073
Synergetics   3860 West First Street   Box 809 Thatcher, AZ 85552
rss: http://www.tinaja.com/whtnu.xml   email: don@tinaja.com

Please visit my GURU's LAIR web site at http://www.tinaja.com

Back to comp.lang.postscript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Filtering problem in GhostScript? Don Lancaster <don@tinaja.com> - 2013-02-09 15:53 -0700
  Re: Filtering problem in GhostScript? Don Lancaster <don@tinaja.com> - 2013-02-09 16:22 -0700
  Re: Filtering problem in GhostScript? SaGS <sags5495@gmail.com> - 2013-02-10 01:10 -0800
    Re: Filtering problem in GhostScript? Don Lancaster <don@tinaja.com> - 2013-02-10 18:39 -0700

csiph-web