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....



CopyDataFromVector


Unit:SDL_datatable
Class: TDataTable
Declaration: [1] function CopyDataFromVector (Src: TVector; FirstElem, LastElem, Col, Row: integer; AsColumn: boolean): integer;
[2] function CopyDataFromVector (Src: TIntVector; FirstElem, LastElem, Col, Row: integer; AsColumn: boolean): integer;

The method CopyDataFromVector copies the cells of the vector Src into the data table. The parameters Col and Row specify the target 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 vector is copied into a column (AsColumn = TRUE) or into a row (AsColumn = FALSE) of the data table.

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

Please note that copying the data does not influence the type of variables (see section Nominal and Ordinal Data for details). If a particular column of the table contains nominal values, the copied data are considered to be the corresponding ordinals.

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: 1 to Src.NrOfElem
-5 ... Col and/or Row are out of range (valid ranges: 1 ≤ ColNrOfColumns, and 1 ≤ RowNrOfRows)


Last Update: 2023-Dec-14