home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
MBUG
/
MBUG027.ARC
/
INPUT.INC
< prev
next >
Wrap
Text File
|
1979-12-31
|
4KB
|
157 lines
overlay PROCEDURE Update(Date : str14);
(* Update is used to update the data base *)
VAR
Ch : CHAR;
k,ok2 : 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,ok2 : 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
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
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
GotoXY(23,5);
Write(Date_Born);
getdate(date_born,4);
END;
5 : BEGIN
GotoXY(23,6);
Write(Date_Died);
getdate(date_died,5);
END;
6 : BEGIN
END;
8,7 : BEGIN
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: InputStr(Comment_3,40,15,11,term,tc);
12: IF sex = 'F' THEN
BEGIN
getdate(date_mated,13);
END
ELSE
TC := ^X;
13: IF sex = 'F' THEN
BEGIN
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;