title: How do I save the contents of this 2d array to a file
body: <p>I Need some help trying to save the contents of the 2d array into a file.
  First of all im not sure what type the file should be etc .txt or dat.</p>
  
  <p>I have edited the post so that the code is in text format not an image.</p>
  
  <p>This is what ive got so far.</p>
  
  <pre><code>program CaptureTheSarum;
  
  {$APPTYPE CONSOLE}
  
  uses
    SysUtils;
  
  Const BoardDimension = 8;
  
  Type
    TBoard = Array[1..BoardDimension, 1..BoardDimension] Of String;
  
  Var
    Board : TBoard;
    GameOver : Boolean;
    StartSquare : Integer;
    FinishSquare : Integer;
    StartRank : Integer;
    StartFile : Integer;
    FinishRank : Integer;
    FinishFile : Integer;
    MoveIsLegal : Boolean;
    PlayAgain : Char;
    SampleGame : Char;
    WhoseTurn : Char;
    savedFile : text;
  
  procedure InitialiseSave;
  var
    fileName : string;
  begin
    fileName := 'SavedGame.dat';
  
    assignfile(savedfile,fileName);
    if not fileexists(fileName)
    then
      begin
        rewrite(savedfile);
        closefile(savedfile)
      end
    {endif};
  end;
  
  procedure saveGame;
  var
   save : string;
   RankNo,FileNo : integer;
  begin
    writeln('Would you like to save the Game?');
    readln(save);
  
    if (save = 'y') or (save = 'Y')
    then
      begin
        reset(SavedFile);
        write(SavedFile,board[fileno,Rankno]);
        closeFile(SavedFile);
      end
    {endif};
  </code></pre>