DataLab is a compact statistics package aiming at exploratory data analysis. Please visit the DataLab Web site for more information....


CopyDataFrom1DArray

Declaration: TDataTable.CopyDataFrom1DArray (Src: TDoubleArray; FirstElem, LastElem, Col, Row: integer; AsColumn: boolean): integer;
The method CopyDataFrom1DArray copies the cells of the dynamic array Src into the data table. The parameters Col and Row specify the first column and row to be used in the data table (the cell Src[FirstElem] is copied to self[Col,Row], all other cells are copied to higher indices, see figure below). The parameter AsColumn controls whether the source array is copied into a column (AsColumn = TRUE) or into a row (AsColumn = FALSE) of the data table.

If the source array does not fit into the data table all excess cells are ignored.

The method return the following error codes:

 0 ... everything is OK
-1 ... the source array Src has zero size
-4 ... FirstElem and/or LastElem are out of range (valid range: 0 to length(Src)-1)
-5 ... Col and/or Row are out of range (valid ranges: 1 ≤ ColNrOfColumns, and 1 ≤ RowNrOfRows)

Hint: Setting both the FirstElem and LastElem parameters to zero is a shortcut for specifying the entire range of cells in the particular dimension.