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.
I have edited the post s
It seems you are trying to make some sort of board game (probably chess).
The main problem you are facing is that you haven't defined your board type as fixed size. You see in Delphi strings are of dynamic size. And while in older versions of Delphi they were limited to 255 characters in newer versions their size is only limited by available memory.
So you should change your board definition (array) to be of fixed type. For most board games you could use 2D array of Char.
TBoard = Array [0..7, 0..7] of Char;
On older non-Unicode versions of Delphi Char will be an AnsiChar which allows you to store 256 different characters or 256 different figures.
On newer Delphi versions that support Unicode you have even more possibilities.
Anyway the best thing about using static array of fixed type is that you can save the whole static array into a file with a single command
procedure SaveGame;
//When having fixed size types you can use File of Type to quickly get
//ability to store whole type at once.
//Note this only works for fixed sized records who don't contain any
//dynamic sized members (strings, dynamic arrays) and static arrays of
//fixed sized type (no strings or other dynamic sized arrays)
//
//With arrays it doesn't even matter whether they are one dimensional
//or multidimensional. but they need to be static
var Savefile: File of TBoard;
FileName: String;
begin
Filename := 'D:\Proba.txt';
//Assign file
Assignfile(Savefile,FileName);
//Check if the file exists if it does open it for editing (reser)
//else open it in rewrite mode which also automatically creates new
//file if the file doesn't exists
if not Fileexists(Filename) then
Rewrite(Savefile)
else
Reset(SaveFile);
//Becouse we have a file of fixed sized type we can write the whole
//type with just one Write command
//your program already know how many bytes it has to write
//
//Note if you want to store multiple savegames in a single file you
//need to use seek to move your current position
//And because we have file of type the seek moves the current position
//by N times of the type size
//So if the size of your type is 64 bytes calling Seek(YourFile,2)
//will move current position to the 128th byte
Write(SaveFile, Board);
//Close file
CloseFile(SaveFile);
end;
Reading the data from your file is done in similar way.
Read(Savefile, Board);
EDIT: If you are on older version of Delphi and the char does not allow you enough possibilities to store the state of your board cell you can always use array of integers like most other grid based games do.