Can someone please add a few statements in the following program to freeze
the header and footer on screen? I want to just scroll the records in
between them but do not know how. Thank you in advance.
PROGRAM Search_By_Edition; {Program to display library books by edition}
USES Crt;
CONST
filename = 'a:\book.dat';
TYPE
BOOKS = RECORD
number : INTEGER;
title: STRING[40];
author: STRING[35];
category: STRING[4];
edition: STRING[3];
price: REAL;
date: STRING[10];
END;
VAR
masterfile: TEXT;
library: ARRAY [1..100] OF BOOKS;
cur_date: STRING[10];
findedition: STRING[3];
found,index: INTEGER;
answer: CHAR;
counter: INTEGER;
BEGIN
clrscr;
gotoxy(27,1);
write('Please enter date today : ');readln(cur_date);
answer := 'Y';
WHILE upcase(answer) = 'Y' DO
BEGIN
clrscr;
index := 1;
counter := 0;
gotoxy(27,3);
writeln('Informatics Institute Taiping');
gotoxy(30,4);
writeln('102 Jalan Taming Sari,');
gotoxy(31,5);
writeln('34000 Taiping Perak');
gotoxy(28,6);
writeln('Tel: 8065600 Fax: 8065602');
gotoxy(5,8);
write('Summary of Books For Edition: ');readln(findedition);
gotoxy(5,9);
writeln('-------------------------------------------------------------------
');
gotoxy(5,10);
writeln('Book Number Category Edition Price
Purchase Date');
gotoxy(5,11);
writeln('-------------------------------------------------------------------
');
{opening file for displaying book category}
assign(masterfile,filename);
reset(masterfile);
found :=0;
WHILE (not eof(masterfile)) DO
WITH library[index] DO
BEGIN
readln(masterfile,number);
readln(masterfile,title);
readln(masterfile,author);
readln(masterfile,category);
readln(masterfile,edition);
readln(masterfile,price);
readln(masterfile,date);
IF findedition= edition THEN
BEGIN
found := 1;
counter := counter + 1;
gotoxy(12,12+counter);
write(number:4);
gotoxy(24,12+counter);
write(category:4);
gotoxy(37,12+counter);
write(edition:3);
gotoxy(46,12+counter);
write('RM',price:7:2);
gotoxy(62,12+counter);
writeln(date:10);
END;
END; {end while}
IF found = 0 THEN
BEGIN
clrscr;
gotoxy(27,10);
writeln('Edition requested is not found');
readln;
END
ELSE
BEGIN
writeln;
writeln('
':4,'-------------------------------------------------------------------');
writeln(' ':4,'Total Record(s) found: ',counter);
writeln(' ':4,'Date : ',cur_date);
readln;
END;
BEGIN
clrscr;
gotoxy(27,12);
write('Search another edition ? [Y/N] >');
readln(answer);
close(masterfile);
END;
END;
END.