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


CopyDataRowTo1DArray

Declaration: TDataTable.CopyDataRowTo1DArray (var Dest: TDoubleArray; Row, FirstCol, LastCol, DestElem: integer): integer;
The function CopyDataRowTo1DArray copies the numeric data of the row Row to the open array Dest.

Nominal data values of the data table are replaced by their ordinals when copying them to Dest. The parameter Row specifies the row to be copied, the parameters FirstCol and LastCol define the range of the cells in row Row, and the parameter DestElem specifies the target position of the first cell. Please keep in mind that the cells of the data table are indexed with base 1 while the target array is indexed with base 0.

The function returns the following error codes:

 0 ... everything is OK, data has been copied
-1 ... invalid parameter Row (valid range is 1 ... NrOfRows)
-2 ... FirstCol and/or LastCol are out of range (valid range: 1 ... NrOfColumns)
-3 ... the parameter DestElem is out of range (valid range: 0 ≤ DestElem < length(Dest))
-4 ... the target array Dest has zero length

Hint: Setting both FirstCol and LastCol to zero values is a shortcut for copying all cells of the specified row.