[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Low-level vs. High-level programming (was My First Computer)



In article <qh8yqmhyzk.fsf@ruckus.brouhaha.com>,
 Eric Smith <eric-no-spam-for-me@brouhaha.com> wrote:

> "Mike Pender" <mpender@spamsucks.com> writes:
> > Well then, show us the code.  I would like to see how you worked around the
> > problem.
> 
> Give me a break, it was twenty years ago.  I don't have the source code
> any more, and even if I did, I couldn't post it because I didn't own it.
> As a work for hire, it belonged to my employer.
> 
> But I didn't have to do anything special to "work around the problem",
> because there was no problem.
> 
> If you really want to see a program that does this, I'd be happy to write
> you a new one at my standard consulting rates.  It would probably take
> about two hours, including installing Apple Pascal on a simulator.

The calssic merge sort typically has three files open; it was a 
demo on disk 4. Here's a trivial example with two files:

program reformat1;
const lf = 10; cr = 13;
var   f,g: text;
begin
  reset(f); rewrite(g);
  while not eof(f) do
    begin
      if eoln(f) then
        begin
          g^ := chr(cr); put(g);
          g^ := chr(lf); put(g)
        end 
      else
        begin
        g^ := f^; put(g)
        end;
      get(f)
    end;
  close(f); close(g)
end.

John
----
jmatthews at wright dot edu
www dot wright dot edu/~john.matthews/