{ outputFiles.p Started by Jeff Ondich on 2/29/96 Last modified 2/29/96 This program illustrates the use of text files in a gpc Pascal program, by asking the user for a file name and a message, creating or erasing the requested file, and writing the message to the file. } program outputfiles(input,output,outFile); var outFile : text; outFileName, message : string(40); begin {Get the file name and the message from the user} write( 'File name? ' ); readln( outFileName ); write( 'What message? ' ); readln( message ); {Open the file for writing, write the message, and close the file} rewrite( outFile, outFileName ); writeln( outFile, message ); writeln( outFile, 'So there.' ); close( outFile ) end.