The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....


Class: TDataTable
Declaration: [1] function CopyDataRowToVector (Row: integer; Dest: TVector): integer;
[2] function CopyDataRowToVector (Dest: TVector; Row, FirstCol, LastCol, DestElem: integer): integer;
[3] function CopyDataRowToVector (Dest: TIntVector; Row, FirstCol, LastCol, DestElem: integer): integer;

The function CopyDataRowToVector copies the numeric data of the row Row to the vector Dest. Version [1] works a little differently than the other versions in that it always copies the entire row and automatically resizes the target vector Dest. The other versions allow to copy parts of a row and do not adjust the size of the target vector. Version [3] rounds the values before copying them to the target vector.

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.

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: 1 ... Dest.NrOfElem)
-4 ... the target vector Dest is not instantiated

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

Last Update: 2023-Dec-14