Reads an optional argument from an OPER
[C++]
template< class T >
bool ReadOptional(
T& result,
const char* pszArgName,
CString& strError,
boolean bStrict = false
);
template< class T >
bool ReadOptional(
T& result,
const char* pszArgName,
CXlOper& xloError,
boolean bStrict = false
);
If an appropriate value is found, then it is converted to the output type and placed in the variable referenced by this parameter.
If the value is missing or empty, then the value is left unchanged.
If the argument cannot be converted, then the output variable will not be affected.
The following types are directly supported for T:
If the input value cannot be converted to the type of result then this name will be used for the error description; e.g. "#Error: could not convert MyArg".
If the input value cannot be converted to the type of result then an error description will be placed into this variable.
If bStrict is set to true, then no attempt will be made to convert strings to numbers and vice versa. If bStrict is false (the default) then standard Excel type transformations will be used.
If the input value cannot be converted to the type of result then an error description string will be placed into this variable.
This function returns true or false as follows:false The argument was of an unexpected type and could not be read. true The argument was missing or empty, and the value of result was left unchanged;
or the value was present and correct, and the value of result was set.
Header: xllplus.h