StoreMatrix

Declaration: StoreMatrix(FName: string; Overwrite: boolean; Matrix: TDouble2DArray; Comment: string): integer;
Stores the data of the two-dimensional array Matrix in the file specified by the parameter FName. The parameter Overwrite controls whether an existing file will be overwritten. The parameter Comment may contain any single-line comment which is stored with the data. Please note that any control characters in the comment are automatically removed before storing it (in order to ensure that the comment is a single line).

The data matrix is stored as a text file using full floating point precision (15 digits). The first line of the file contains the version number, the second line the comment and the third line contains the number of columns and rows (separated by a blank). The following lines contain the data values which are stored rowwise (i.e. NRow lines with NCol values each).

The function resturns the following error codes:

 0 ... everything is OK
-1 ... file name empty or matrix has size zero
-2 ... file write error (readonly, disk full)
-3 ... file already exists (only checked if Overwrite is FALSE)