home *** CD-ROM | disk | FTP | other *** search
/ Game Killer / Game_Killer.bin / 266.PART4.INC < prev    next >
Text File  |  1991-07-08  |  1KB  |  45 lines

  1. procedure partIV( var space : TheVoid );
  2. var
  3.   Exists : array [ sector ] of boolean;
  4.   temp,
  5.   was    : boolean;
  6.   n      : integer;
  7.   s      : sectorIndex;
  8.   line   : string;
  9. begin
  10.   for s := 1 to MaxSector do
  11.     exists[ s ] := false;
  12.   repeat
  13.     readln( f, line );
  14.   until (pos( 'Deployed  Fighter  Scan', line) > 0) or eof(f);
  15.   if eof(f) then
  16.     exit;
  17.   readln( f, line );   {blank}
  18.   readln( f, line );   { Sector Fighters ...}
  19.   readln( f, line );   {===}
  20.   readln( f, line );   {first line of display}
  21.   while pos( 'Total', line) = 0 do
  22.     begin
  23.       temp := bval( copy(line, 1, 6), n );
  24.       s := n;
  25.       exists[ s ] := true;
  26.       readln( f, line );
  27.     end; {while}
  28.   for s := 1 to MaxSector do
  29.     begin
  30.       Was := (space.sectors[ s ].etc and HasFighters) <> Nothing;
  31.       if was and (not exists[ s ]) then
  32.         begin
  33.           writeln('Lost fighters in sector ', s );
  34.           space.sectors[s].etc := space.sectors[s].etc and (not HasFighters);
  35.         end {if}
  36.       else if exists[ s ] and (not was) then
  37.         begin
  38.           writeln('New fighters in sector ', s );
  39.           space.sectors[s].etc := space.sectors[s].etc or HasFighters;
  40.         end; {else}
  41.     end; {for}
  42.   SaveData( g, space );
  43.   write('Hit return to continue...');
  44.   readln;
  45. end; {Part4}