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
/
PEDIGREE.INC
< prev
next >
Wrap
Text File
|
1979-12-31
|
3KB
|
104 lines
overlay PROCEDURE Pedigree(date : str11);
LABEL
ESCAPE;
VAR
ptr : INTEGER;
ear : str5;
PROCEDURE ped(child : Animal_rec);
VAR
gp : ARRAY[1..20,1..2] OF str5; {Grand parents}
name : ARRAY[1..20] OF str20;
ear2 : ARRAY[1..20] OF str5;
parent : INTEGER;
y,x : INTEGER;
l,z : INTEGER;
BEGIN
RESET(infile);
parent := 1;
x := 1;
y := 1;
L := 1;
gp[parent,1] := child.sire;
gp[parent,2] := child.dam;
parent := parent + 1;
REPEAT
find_ear(ptr,gp[x,L]);
seek(infile,ptr);
Read(infile,Animal);
name[parent - 1] := Animal.name;
ear2[parent - 1] := Animal.ear_No;
gp[parent,1] := Animal.sire;
gp[parent,2] := Animal.dam;
parent := parent + 1;
y := y + 1;
IF L = 2 THEN x := x + 1;
IF L = 1
THEN L := 2
ELSE L := 1;
UNTIL x = 8;
Writeln(Q);
Writeln(Q);
Writeln(Q,' ':37-(Length(child.name) DIV 2),child.name);
Writeln(Q,' |');
Writeln(Q,' +-----------------------+------------------------+');
Writeln(Q,' | PARENTS |');
Writeln(Q,' 1 ',gp[1,1],' 2 ',gp[1,2]);
Writeln(Q,' | |');
Writeln(Q,' +---+--------------+ GRAND PARENTS +-------------+---+');
Writeln(Q,' | | | |');
Writeln(Q,' 3 ',gp[2,1],' 4 ',gp[2,2],' 5 ',gp[3,1],' 6 ',gp[3,2]);
Writeln(Q,' | | | |');
Writeln(Q,' | |GREAT GRAND PARENTS| |');
Writeln(Q,' +---+-----+ +----+----+ +-----+----+ +----+----+');
Writeln(Q,' | | | | | | | |');
Writeln(Q,' 7 ',gp[4,1],' 8 ',gp[4,2],' 9 ', gp[5,1],' 10 ',
gp[5,2],' 11 ', gp[6,1],' 12 ' ,gp[6,2],' 13 ', gp[7,1],' 14 ', gp[7,2]);
Writeln(q);
Writeln;
Write('Press RETURN to continue ':50);
Readln;
Writeln(Q);
Writeln(Q);
ClrScr;
line(1);
GotoXY(1,2);
Write(Q,' P E D I G R E E of');
ClrEOL;
Write(Q,' ',child.name,' ':20-Length(child.name));
Writeln(Q);
Writeln(Q);
FOR x := 1 TO parent - 2 DO
BEGIN
Writeln(Q,x:10,' ',ear2[x],' ',name[x],' ':20 - Length(name[x]),gp[x+1,1]: 7,gp[x + 1,2]:7);
IF x = 2
THEN Writeln(q);
IF x = 6
THEN Writeln(q);
END;
END;
BEGIN
line(1);
dis(1,2,' P E D I G R E E ');
print;
IF ch <> #27 THEN
BEGIN
line(1);
GotoXY(1,2);
Write(Q,date,' P E D I G R E E of');
ClrEOL;
Write(Q,' ',Animal.name,' ':20-Length(Animal.name));
ped(Animal);
ASSIGN(Q,'CON:');
REWRITE(Q);
Write('Press RETURN to continue ':50);
Readln;
ClrScr;
END;
ch := ^M;
END;