home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
mbug
/
mbug027.arc
/
TTINPUT.INC
< prev
next >
Wrap
Text File
|
1979-12-31
|
5KB
|
166 lines
OVERLAY PROCEDURE Update(Date : str14);
(* Update is used to update the data base *)
VAR
Ch : CHAR;
k,ok2 : INTEGER;
I,D,Ptr : integer;
PROCEDURE InputAnimal(VAR Animal : Animal_Rec; VAR ch : CHAR);
CONST
Term : CharSet = [^E,^I,^M,^X,^Z,#27];
VAR
L : INTEGER;
TC : CHAR;
ear : str5;
PROCEDURE get_parents;
VAR
dummy1 : str1;
ch : CHAR;
k : INTEGER;
BEGIN
dummy1 := '';
k := 0;
Read(kbd,dummy1);
val(dummy1,k,ok2);
IF k IN [1..6]
THEN
BEGIN
WITH Animal_Table[k] DO
BEGIN
ch := sex;
CASE ch OF
'M' : BEGIN
if L <> 13 then
begin
Animal.sire := Ear_No;
dis(23,7,name);
ClrEOL;
end;
if L = 13 then
BEGIN
Animal.partner := Ear_No;
dis(57,14,name);
end;
END;
'F' : BEGIN
if L <> 13 then
Animal.dam := Ear_No;
dis(23,8,name);
ClrEOL;
END;
END;{case}
END;{with}
END;{ K in [1..6]}
END;
BEGIN
L := 1;
ear := '';
WITH Animal DO
REPEAT
CASE L OF
1 : BEGIN
dis(1,17,foot3);
InputStr(Ear_No,5,22,3,term,tc);
Ear_No := UpcaseStr(Ear_No);
Fillup(Ear_No);
END;
2 : InputStr(Name,20,46,3,term,tc);
3 : BEGIN
dis(1,17,foot3);
InputStr(sex,1,75,3,term,tc);
IF sex <> ''
THEN
IF (sex IN ['m','M','f','F'])
THEN
sex := UpCase(sex)
ELSE
sex := '';
END;
4 : BEGIN
dis(1,17,foot4);
GotoXY(23,5);
Write(Date_Born);
getdate(date_born,4);
END;
5 : BEGIN
dis(1,17,foot4);
GotoXY(23,6);
Write(Date_Died);
getdate(date_died,5);
END;
8,7 : BEGIN
dis(1,17,foot3);;
LowVideo;
GotoXY(1,7);
write('Selete from ');
gotoXY(1,8);
write('Parent table.');
NormVideo;
GotoXY(13,7);
get_parents;
IF sire = ''
THEN BEGIN
sire := '!000M';
dis(23,7,'Un Known Male');
ClrEOL;
END;
IF dam = ''
THEN BEGIN
dam := '!000F';
dis(23,8,'Un Known Female');
ClrEOL;
END;
GotoXY(1,7); write(' ');
GotoXY(1,8); write(' ');
END;
9 : InputStr(Comment_1,40,15,9,term,tc);
10: InputStr(Comment_2,40,15,10,term,tc);
11: begin
dis(1,17,foot3);
InputStr(Comment_3,40,15,11,term,tc);
end;
12: if sex = 'F' then
BEGIN
dis(1,17,foot4);
getdate(date_mated,13);
END
ELSE
TC := ^X;
13: IF sex = 'F' THEN
BEGIN
dis(1,17,foot3);
LowVideo;
gotoxy(40,14);
write('P/Table');
NormVideo;
gotoxy(57,14);
get_parents;
gotoxy(40,14);
write(' ');
END
ELSE
begin
if TC = ^E then L := 11 else
TC := ^X;
end;
END; {Case of L}
CASE TC OF
^M,^I,^X
: BEGIN
L := L + 1;
IF L = 14
THEN L := 1;
END;
^E : BEGIN
L := L - 1;
IF L = 0
THEN L := 13;
END;
END; {case of TC}
UNTIL (TC = ^Z) OR (TC = #27);
ch := TC;
END;