XLL+ Class Library

COper::ToDoubleArray

Copies the contents of an OPER into a 'C' array of doubles or pointers to doubles

[C++]
BOOL ToDoubleArray(
   double* pd,
   USHORT cRows,
   BOOL bStrict = FALSE
) const;
BOOL ToDoubleArray(
   double* pd,
   USHORT cRows,
   USHORT cCols,
   BOOL bByRows = FALSE,
   BOOL bStrict = FALSE
) const;
BOOL ToDoubleArray(
   double** apd,
   USHORT cRows,
   USHORT cCols,
   BOOL bByRows = FALSE,
   BOOL bStrict = FALSE
) const;

Parameters

pd

An array of double's, containing either cRows items, or (cRows x cCols) items, depending on the function variant used. For the latter type, the values will be arranged in the order specified by the bByRows parameter.

cRows

The number of rows contained in the supplied array of doubles.

bStrict

If bStrict is FALSE (the default) then, if any of the cells in the COper do not contain a double, the function will safely return an appropriate converted value.

If bStrict is TRUE then the function will fail and return FALSE unless every cell in COper contains a double.

cCols

The number of columns contained in the supplied array of doubles.

bByRows

Storage order of arrays of double's. If TRUE, then values in the same row are stored contiguously, otherwise values in the same column are assumed to be stored contiguously.

apd

An array of pointers to double, containing either cRows arrays each of size cCols, or cCols arrays each of size cRows, depending on the order specified by the bByRows parameter

Return value

This function returns TRUE if any of the cells in a COper have been successfully read into the array(s) as numbers, FALSE otherwise.

Remarks

This function reads the values in a COper into a 1- or 2-dimensional array of doubles.

This function can be hard work to use. The methods COper::RowToVector(), COper::ColToVector() and COper::ToMatrix() offer a much easier way to inspect a numeric array, since they also handle memory allocation and freeing as well as offering more powerful error handling and input-checking.

Example

COper::ToDoubleArray() Examples

Requirements

Header: xllplus.h

See Also

COper Class | COper Methods