Path: csiph.com!aioe.org!.POSTED.T3p5Iplo8Qapd43srEM3cA.user.gioia.aioe.org!not-for-mail From: news@zzo38computer.org.invalid Newsgroups: comp.lang.postscript Subject: Re: file operations. Date: Sun, 08 Mar 2020 14:39:34 -0700 Organization: Aioe.org NNTP Server Lines: 22 Message-ID: <1583703381.bystand@zzo38computer.org> References: <45079feb-1563-47ba-9cdf-02bdc86e3b2c@googlegroups.com> NNTP-Posting-Host: T3p5Iplo8Qapd43srEM3cA.user.gioia.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: bystand/1.0.1 X-Notice: Filtered by postfilter v. 0.9.2 Xref: csiph.com comp.lang.postscript:3497 douglas.mcallaster@gmail.com wrote: > > Folks, > > Can anyone fix and post a working read-one-char job? > > %---read-one-char job-fails > /strx (X) def > (donin.txt) (r) file /myworkfile exch def > {myworkfile read { strx exch 0 exch put > = } > {myworkfile closefile exit} ifelse > } loop > quit The problem is that the "=" should be "strx ="; that is why it doesn't work. If you make that change, then it will work. The original code does not have any input for the = so the operand stack is empty by that time, and it won't work. -- Note: I am not always able to read/post messages during Monday-Friday.