Код:
uses crt;
type str25=string[25];
base=record
vid:string[12];
name:string[10];
kol_vo:string[9];
nazv:string[12];
cena:string[4];
end;
pitem=^item;
item=record
data:base;
next:pitem;
end;
const
menu1:array[1..7] of str25=('vvod','vivod','pouck','dobavlenie','udalenie','grafic','exit');
function menu(A:array of str25;x,y:integer):Integer;
var
ch:char;
sel,i:integer;
n:word;
begin
clrscr;
n:=high(a);
sel:=0;
repeat
for i:=0 to n do
begin
if i=sel then
begin
textcolor(blue);
textbackground(white);
end
else
begin
textcolor(white);
textbackground(white)
end;
gotoxy(x,y+i);
write(a[i]); end;
writeln;
repeat until keypressed;
ch:=readkey;
if ch=#0 then ch:=readkey;
case ch of
#27:begin halt (1) end;
#72:if sel=0 then sel:=n else sel:=sel-1;
#80:if sel=N then sel:=0 else sel:=sel+1;
end;
until ch=#13;
menu:=sel+1;
end;
procedure vvod1 (var first,last:pitem);
begin
first:=nil;
last:=nil;
end;
function isempty(first,last:pitem):boolean;
begin
isempty:=first=nil;
end;
function isfull(first,last:pitem):boolean;
begin
isfull:=maxavail>=sizeof(item);
end;
Function vvod (var first,last:pitem):boolean;
var
c:pitem;
f,n,o,p,s:string;
h:word;
fl:byte;
begin
if isfull(first,last) then
begin
clrscr;
vvod:=true;
new(c);
write('vvedite vid zapchasti---');
readln(c^.data.vid);
write('vvedite izgotovitelya---');
readln(c^.data.name);
write('vvedite kolichestvo---');
readln(c^.data.kol_vo);
write('vvedite nazvanie---');
readln(c^.data.nazv);
write('vvedite cenu---');
readln(c^.data.cena);
c^.next:=first;
first:=c;
if last=nil then last:=c;
end else
vvod:=false;
end;
procedure vivod (first,last:pitem);
var
c:pitem;
i:integer;
begin
clrscr;
writeln(': vid ':' : strana ':': kol_vo ':': nazvanie':': cena ':' :');
writeln('.........................................................................');
c:=First;
i:=1;
while c<>nil do
begin
if (i mod 19)<>0 then begin
writeln(': ',c^.data.vid:10,' :',c^.data.name:8,' :',c^.data.kol_vo:10,' :',c^.data.nazv:10,' :',c^.data.cena:10,' :');
c:=c^.next;
i:=i+1;
end
else
begin
readln;
i:=i+1;
clrscr;
writeln(': vid ':' : strana ':': kol_vo ':': nazvanie':': cena ':' :');
writeln('.........................................................................');
end;
end;
readln;
end;
procedure poisk ;
begin
writeln('poisk');
readln;
end;
procedure add ;
begin
writeln('dobavlenie');
readln;
end;
procedure udalenie (first,last:pitem);
begin
writeln('udalenie');
readln
end;
procedure grafic ;
begin
writeln('grafic');
readln;
end;
var
first,last:pitem;
x:integer;
begin
textBackGround(white);
repeat
x:=Menu(Menu1,1,1);
case x of
1:vvod(first,last);
2:vivod(first,last);
3:poisk;
4:add;
5:udalenie(first,last);
6:grafic;
7:writeln ('exit');
end;
until x=7;
end.
помогите с процедурой удаления и редактирования. Смысл заключается в том что надо удалить какую либо строку по двум ключевым полям, например мне надо удалить строку "армортизаторы" от производителя "KONI", а строка с армортизаторами от другого производителя должна быть не тронута.
Помогите, буду благодарен.