MtxDialogs.GridToValues Method

Overload List

#SignatureDescription
1function GridToValues(Dst: TMtx; Src: TStringGrid; SrcRow, SrcCol, Row,Col, RowCount, ColCount: Integer; IsComplex: boolean = false): TMtx; overload;Convert elements of the Src to values array of the Dst matrix.
2function GridToValues(Dst: TMtx; Src: TStringGrid; IsComplex: boolean = false; Headers: boolean = True): TMtx; overload;Convert all elements of the Src to values array of the Dst matrix.
3function GridToValues(Dst: TVec; Src: TStringGrid; IsComplex: boolean = false; Vertical: boolean = True; Headers: boolean = True): TVec; overload;Converts the content of TStringGrid to an array of values.
4function GridToValues(Dst: TVec; Src: TStringGrid; SrcRow,SrcCol,Index,Len: integer; IsComplex: boolean; Vertical: boolean = True): TVec; overload;Converts elements of the Src to values array of the Dst.

Overload 1: function GridToValues(Dst: TMtx; Src: TStringGrid; SrcRow, SrcCol, Row,Col, RowCount, ColCount: Integer; IsComplex: boolean = false): TMtx; overload;

Convert elements of the Src to values array of the Dst matrix.

#NameTypeDescription
1DstTMtx
2SrcTStringGrid
3SrcRowInteger
4SrcColInteger
5RowInteger
6ColInteger
7RowCountInteger
8ColCountInteger
9IsComplexboolean

Returns: TMtx

Remarks:

If IsComplex is true then two consecutive horizontal cells in TStringGrid will be treated as single complex value. If IsComplex is false then each horizontal cell will be treated as separate real value. The acquisition starts at [SrcRow,SrcCol] cells and stops at [SrcRow+RowCount,SrcCol+ColCount] cell. Values are then copied to the Dst [Row,Col]..[Row+RowCount,Col+ColCount] submatrix.

The size of the Dst matrix must be set explicitely.

See Also: MtxDialogs.ValuesToGrid, MtxDialogs.ValuesToGrid, MtxDialogs.ValuesToGrid, MtxDialogs.ValuesToGrid

Overload 2: function GridToValues(Dst: TMtx; Src: TStringGrid; IsComplex: boolean = false; Headers: boolean = True): TMtx; overload;

Convert all elements of the Src to values array of the Dst matrix.

#NameTypeDescription
1DstTMtx
2SrcTStringGrid
3IsComplexboolean
4Headersboolean

Returns: TMtx

Remarks:

If IsComplex is true then two consecutive horizontal cells in TStringGrid will be treated as single complex value. If IsComplex is false then each horizontal cell will be treated as separate real value. The acquisition starts at [0,0]. If Headers is True, the first column and first row are ignored and submatrix starts at [1,1].

The Rows and Cols properties of the Dst matrix are set automatically.

Overload 3: function GridToValues(Dst: TVec; Src: TStringGrid; IsComplex: boolean = false; Vertical: boolean = True; Headers: boolean = True): TVec; overload;

Converts the content of TStringGrid to an array of values.

#NameTypeDescription
1DstTVec
2SrcTStringGrid
3IsComplexboolean
4Verticalboolean
5Headersboolean

Returns: TVec

Remarks:

Converts all elements of the Src to values array of the Dst. If Vertical is true then each row will be treated as separate number. If Vertical is false then each column will be treated as separate number. If IsComplex is true then two horizontal/vertical cells in stringgrid will be treated as single complex value. If IsComplex is false then single horizontal/vertical cell will be treated as separate real value. The acquisition starts at [0,0]. If Headers is True, the first column and first row are ignored and submatrix starts at [1,1]

Note
The Length of the Dst vector is set automatically.

Overload 4: function GridToValues(Dst: TVec; Src: TStringGrid; SrcRow,SrcCol,Index,Len: integer; IsComplex: boolean; Vertical: boolean = True): TVec; overload;

Converts elements of the Src to values array of the Dst.

#NameTypeDescription
1DstTVec
2SrcTStringGrid
3SrcRowinteger
4SrcColinteger
5Indexinteger
6Leninteger
7IsComplexboolean
8Verticalboolean

Returns: TVec

Remarks:

If Vertical is true then each row will be treated as separate number. If Vertical is false then each column will be treated as separate number. If IsComplex is true then two horizontal/vertical cells in stringgrid will be treated as a single complex value. If IsComplex is false then single horizontal/vertical cell will be treated as a separate real value. The acquisition starts at [SrcRow,SrcCol] cells and stops at [SrcRow+Len,SrcCol+1(or two for complex)] cell. Values are copied then copied to calling vector [Index,Index+Len] values array.

Note
The Length of the Dst vector is not changed and must be preset.