{The index to all of Carl Drott's Pascal examples is at:} { http://drott.cis.drexel.edu/CommandFinder.html } program InOut; var line, lineout, myinfile, myoutfile: string; point, size: integer; source, sink: text; begin writeln('please name the INPUT file'); readln(myinfile); reset(source, myinfile); writeln('please name the OUTPUT file'); readln(myoutfile); rewrite(sink, myoutfile); while not eof(source) do {reads till no more in file} begin readln(source, line); writeln('processing-- ', line); lineout := ''; for point := 1 to length(line) do begin lineout := concat(line[point], lineout); end; writeln(sink, lineout); writeln('result is-- ', lineout); end; writeln('all data from ', myinfile, ' processed'); writeln('and stored in ', myoutfile); end.