{ This program illustrates the use of the predeclared procedures read and readln: } program three3; var a,b,c,y,z: char; datafile: text; begin { 3-3 } rewrite(datafile,':F1:TDATA.DAT'); { create a temporary file on drive 1 } writeln(datafile,'AB'); { write a two character line } writeln(datafile,'YZ'); { and a two character line } reset(datafile); { re-position file to the beginning } a := '1'; { initialize variables } b := '2'; c := '3'; y := '8'; z := '9'; read(datafile,a,b,c,y,z); { c := ' ' since at end-of-line } writeln(a,b,c,y,z); { display the values } reset(datafile); a := '1'; b := '2'; c := '3'; y := '8'; z := '9'; readln(datafile,a); { read the 'A'; skip to the next line } readln(datafile,y); { read the 'Y' and skip to eof } writeln(a,b,c,y,z); close(datafile); end. { 3-3 } { Executing this program will result in the following output: AB YZ A23Y9 }