program testFiles2(input, output, infile,outfile); var infile, outfile : text; infileName, outfileName : String; line : String; begin writeln (' please enter the name of your input file and hit return '); writeln (' note that the file must already exist '); readln (infileName); writeln (' please enter the anem of your output file and hit return '); writeln (' this file does not have to exist '); readln (outfilename); assign (infile, infileName); assign (outfile, outfileName); reset (infile); rewrite (outfile); (* if you want the same information to go to the screen and a file *) (* you need two write statements. You can write a procedure which *) (* will take the information to be written as a parameter, and a *) (* the file as a second parameter and have two write statements *) (* in the procedure NOTE that the file parameter must be a VAR *) (* parameter *) write (' this should come to the screen '); write (outfile, 'this should go to the file '); writeln (); writeln (outfile); readln (infile, line); writeln (outfile, line); writeln (line); close (infile); close (outfile); END.