{The index to all of Carl Drott's Pascal examples is at:} { http://drott.cis.drexel.edu/CommandFinder.html } program OutDemo; const space = ' '; var sent, first, last: string; here, I: integer; whereto: text; {the internal name for my file} begin rewrite(whereto, 'myout'); {define an external name} { for my file} sent := 'this is a neat output test'; for I := 1 to 10 do begin writeln(whereto, sent); {write to the file} writeln(whereto); writeln('processing', I); {write to the screen} here := pos(space, sent); first := copy(sent, 1, here); last := copy(sent, here + 1, (length(sent) - here)); sent := concat(last, space, first); end; writeln(whereto, 'end of program'); writeln('end of program'); end.