home *** CD-ROM | disk | FTP | other *** search
/ Game Killer / Game_Killer.bin / 096.UNKNOWN.INC < prev    next >
Text File  |  1992-06-25  |  1KB  |  38 lines

  1. procedure unknownSectors;
  2. { Are there sectors that are not anchored?  Print out a list. }
  3. var
  4.   Aware : array [ sector ] of boolean;
  5.   i     : sector;
  6.   t     : warpindex;
  7.   f     : text;
  8.   fname : string;
  9.   count : word;
  10. begin
  11.   write('File name for output?  (Hit return for screen)  ');
  12.   for i := 1 to MaxSector do
  13.     aware[ i ] := false;
  14.   readln( fname );
  15.   assign( f, fname );
  16.   rewrite( f );
  17.   for i := 1 to MaxSector do
  18.     if space.sectors[i].number <> Unexplored then
  19.       begin
  20.         for t := 1 to space.sectors[i].number do
  21.           aware[ space.sectors[i].data[t] ] := true;
  22.         aware[ i ] := true;
  23.       end; {for if}
  24.   writeln(f, 'Here are the ''unattached'' sectors: ');
  25.   count := 0;
  26.   for i := 1 to MaxSector do
  27.     if not aware[ i ] then
  28.       begin
  29.         write(f, i : 5 );
  30.         count := count + 1;
  31.         if count mod 10 = 0 then
  32.           writeln( f );
  33.       end;
  34.   if count = 0 then writeln(f, ' NONE!');
  35.   writeln(f);
  36.   if fname <> '' then
  37.     close( f );
  38. end;