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


CopyDataTo2DArray

Declaration: TDataTable.CopyDataTo2DArray (var Dest: TDouble2DArray; SrcColLo, SrcRowLo, SrcColHi, SrcRowHi, DestCol, DestRow: integer): integer;

The method CopyDataTo2DArray copies the cells of the data table in the range from [SrcColLo,SrcRowLo] to [SrcColHi,SrcRowHi] to the position [DestCol, DestRow] of the dynamic array Dest. If any of the cells to be copied fall outside of the destination range these cells are ignored.

The function returns the following error codes:
 0 ... everything is OK
-1 ... the destination array has zero size
-2 ... SrcColLo and/or SrcColHi are out of range (valid range: 1 to NrOfColumns)
-3 ... SrcRowLo and/or SrcRowHi are out of range (valid range: 1 to NrOfRows)
-4 ... DestCol and/or DestRow are out of range (valid ranges: 0 ≤ DestCol < length(Dest), and 0 ≤ DestRow < length(Dest[0])

 

Hint 1: As a shortcut, setting both the ...Lo and the ...Hi parameters to zero is equal to processing the entire range of available source columns or rows.

Hint 2: If you want to copy the entire numeric data into a two-dimensional array, the method DuplicateDataAsArray is more convenient.