XLL+ Class Library (6.3)

CXlOper::FromNumericVector

Assigns a 1-dimensional array of numbers to the CXlOper

template< class T >
BOOL FromNumericVector(
   const std::vector<T>& vec,
   BOOL bRow = FALSE,
   long lLBound = 0
);

Parameters

vec

1-dimensional array of numeric data.

The following types for T are directly supported:

  • long
  • unsigned long
  • int
  • unsigned int
  • short
  • unsigned short
  • double
  • float
This template function will fail to compile for a vector whose members cannot be cast to double.

bRow

If TRUE, then the vector created will be a row; otherwise the vector will be a column.

lLBound

The lower bound of "interesting" inputs. The first lLBound items in the input vector will be ignored.

Return Value

Returns TRUE if the function succeeded, FALSE if it failed.

Remarks

This function sets the type of the CXlOper to be an array with a single column or row, allocates space for the vector of numbers provided and sets the values into the CXlOper.

Note that this method ensures that all integer numeric types are returned to Excel as floating point numbers. To return integer types as boolean values, use CXlOper::FromVector2().

The method will fail and return FALSE if the size of the vector is 0 or if it is too large.

NoteNote:

This method is deprecated. Use FromNumericVector2 instead.

Requirements

Header: xllplus.h

See Also

CXlOper Class | CXlOper Methods | CXlOper::operator = | CXlOper::CXlOper | CXlOper::FromVector2