Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.mixmin.net!feed.xsnews.nl!border-2.ams.xsnews.nl!feeder.xennanews.com!nf39.xennanews.com!not-for-mail From: Cecil Westerhof Newsgroups: comp.lang.postscript Subject: Putting lines from a file into an array Organization: Decebal Computing X-Homepage: http://www.decebal.nl/ Date: Sun, 02 Dec 2012 21:02:55 +0100 Message-ID: <87624kp6hc.fsf@Compaq.site.inet> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) Cancel-Lock: sha1:tDYIsUvtCGxrS29wchfX5JBFhic= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@xennanews.com Lines: 52 NNTP-Posting-Host: 84.53.123.169 (84.53.123.169) NNTP-Posting-Date: Sun, 02 Dec 2012 21:14:30 +0100 Xref: csiph.com comp.lang.postscript:1127 I have the following script: /buffer 80 string def /inputFile INPUT (r) file def { inputFile buffer readline { = }{ pop inputFile closefile exit } ifelse } loop This displays the file. But instead of displaying I would like to put the lines into an array. Just keeping the values on the stack Like: /buffer 80 string def /inputFile INPUT (r) file def { inputFile buffer readline { % Keep it on the stack }{ pop inputFile closefile exit } ifelse } loop stack does not work, because the lower values are overwritten. The first script gives: They are not only idle who do nothing, but they are idle also who might be better employed. Socrates While the second gives: Socrates Socratest be better employed. Socratest be better em Socratest be better employed. nothing, How would I get the lines correctly into an array? -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof