1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
| procedure rech_doc_auteur(var fd:f_doc;posx,posy,n:byte);(**rechercher par auteur***)
var buffer_doc:enreg_doc;
compt,y,i,h:byte;
lauteur:chaine_20;
choi:char; tab:array[1..100] of byte; label ici;
begin
ici: repeat
clrscr;
tab[1]:=5 ;
for i:=2 to 100 do tab[i]:=5;
h:=1;
window(1,1,80,50);
textbackground(white);clrscr;
window(1,1,80,3);textbackground(pink);clrscr;
gotoxy(30,2);write('Entrer L''Auteur Du Document:');
readln(lauteur);
clrscr;
repeat
compt:=0;
seek(fd,0);
while (not eof(fd))do
begin
with buffer_doc do
begin
read(fd,buffer_doc);
if auteur=lauteur then
begin
compt:=compt+1;
if compt=1 then
begin
window(1,1,80,6);textbackground(3);clrscr;
gotoxy(20,2);write('*********************************************');
textcolor(white);
gotoxy(20,3);write(' resultats de la recherche');
textcolor(0);
gotoxy(20,4);write('----------------------------------');
window(2,8,20,10);textbackground(3);clrscr;
gotoxy(1,2);write(' code');
window(20,8,40,10);textbackground(3);clrscr;
gotoxy(1,2);write(' titre');
window(40,8,60,10);textbackground(3);clrscr;
gotoxy(1,2);write(' editeur');
window(60,8,70,10);textbackground(3);clrscr;
gotoxy(1,2);write(' auteur');
window(70,8,80,10);textbackground(3);clrscr;
gotoxy(1,2);write('ann-edition');y:=12;
end ;
window(2,y,80,y+2);textbackground(tab[compt]);clrscr;
gotoxy(1,2);write(code); gotoxy(20,2);write(titre);
gotoxy(40,2);write(editeur); gotoxy(60,2);write(auteur);
gotoxy(70,2);write(' ',ann_edit);
y:=y+2;
end
end;
end;
if compt=0 then
begin
textcolor(0);
window(1,1,80,8);textbackground(green);clrscr;
gotoxy(30,2);
write('document introuvable ou titre invalide!'); y:=8;
end;
window(2,y+2,70,y+6);textbackground(3);clrscr;
gotoxy( 1,2); write ('voulez-vous rechercher un autre document(o/n)?:');
choi:= readkey;
case choi of
#0: begin
choi:=readkey;
case choi of
#72: begin
if h>1 then h:=h-1
else h:=compt ;
end;
#80:h:=(h mod compt)+1;
end;
tab[h]:=6;
for i:=1 to compt do
if h<>i then tab[i]:=5;
end;
'O','o':goto ici;
end;
until upcase(choi)='N';
until upcase(choi)='N';
end; |
Partager