Copy1Dto2DArray
Declaration: 
Copy1Dto2DArray (Src: TDoubleArray; FirstElem, LastELem, Col, Row: integer; var Dest: TDouble2DArray; AsColumn: boolean): integer; 
The function Copy1Dto2DArray copies the 1dimensional array Src into a column or row of the target matrix Dest. The range of the copied cells is controlled by the parameters FirstElem and LastElem. Set FirstElem and LastElem to zero in order to copy the entire source array. The first cell of the target matrix to be filled is specified by the parameters Col and Row. All other elements of the array are copied into consecutive cells, either in the column Col (if AsColumn is TRUE) or in the row Row (if AsColumn is FALSE). Please note that all parameters are zerobased array indices.
The function returns the following error codes:
0 ... everything is OK
1 ... FirstElem and/or LastElem are outside the source array
2 ... Col and/or Row are outside of destination matrix

