home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
mbug
/
mbug027.arc
/
TTEDIT.INC
< prev
next >
Wrap
Text File
|
1979-12-31
|
1KB
|
54 lines
PROCEDURE edit( Animal : Animal_rec);
Label
Escape;
VAR
ch : CHAR;
ear : str5;
name : str20;
BEGIN
dis(1,2,' E D I T M E N U ');
DisDate;
dis(1,17,foot3);
ClrEOL;
ear := Animal.ear_no;
name := Animal.Name;
repeat
inputAnimal(Animal,ch);
dis(1,2,' ');
if ch = ^Z then goto escape;
if Animal.ear_no = ear then
begin
ok := false;
end
else
begin
FindKey(EarIndexFile,I,Animal.Ear_No);
if OK then
begin
GotoXY(10,9);
LowVideo;
Write(' D U P L I C A T E Ear number ');
NormVideo;
BEEP;
end;
end;
until Not OK;
GotoXY(10,9);
Write(' ');
PutRec(DatF,Ptr,Animal);
UpDate_Animal_Table(Animal);
if Animal.Ear_No <> Ear then
begin
DeleteKey(EarIndexFile,Ptr,Ear);
AddKey (EarIndexFile,Ptr,Animal.Ear_No);
end;
if Animal.Name <> Name then
begin
DeleteKey(NameIndexFile,Ptr,Name);
AddKey (NameIndexFile,Ptr,Animal.Name);
end;
escape:
END;