Procedure DeleteSpouse;

{***************************************************************************}

var

  GoneSpouse: integer;

  alpha,

  bravo: integer;

  Gender: char;

  Father,

  Mother,

  NumChildren, NumSpouses, NumSiblings: integer;

begin

  clrscr;

  ReadPos(PresentRec, Gender, Father, Mother, NumChildren, NumSpouses,

    NumSiblings);

  writeln('0) None of these');

  for alpha := 1 to NumSpouses do

    WriteName(Spouse[alpha]);

  writeln;

  write('Delete which Spouse?:  ');

  readln(GoneSpouse);

  if GoneSpouse <> 0 then

    begin

      bravo := 0;

      for alpha := 1 to NumSpouses do

        begin

          if Spouse[alpha] = GoneSpouse then

            bravo := alpha;

        end;

      if bravo <> 0 then

        begin

          NumSpouses := NumSpouses - 1;

          for alpha := 1 to NumSpouses do

            if alpha >= bravo then

              Spouse[alpha] := Spouse[alpha+1];

          EnterPos(Str3(PresentRec), Gender, Father, Mother, NumSpouses,

            NumSpouses, NumSiblings);

          writeln('The Spouse was deleted.');

        end

      else

        writeln('No Spouse was deleted.');

    end

  else

    writeln('No Spouse was deleted.');

  PoliteWait;

  clrscr;

  ReadDat(PresentRec);

end;

