XLL+ Class Library (6.3)

ScalarType Element

This element defines an extended scalar type. It may contain any or all of the following optional child elements, each of which may appear only once or not at all: LocalizedDisplayName, LocalizedDescription, Parameters. It must contain the following required attributes: name, cppType, excelType and converterType. It may contain the following optional attributes: headerFiles, ignoreLocalHeaders, optionalAllowed and converterTypeArguments.

Attributes

converterType

Required. The converterType attribute should contain the name of the class which will convert values between their Excel form (as specified by the excelType attribute) and the native C++ form (as specified by the cppType attribute). The class name should include a namespace if necessary. Any tokens in the form "{n}", where n is an integer, will be replaced the value of the nth parameter.

converterTypeArguments

The converterTypeArguments attribute, if provided, should contain a comma-separated list of arguments that will be passed to the constructor of the converter class instance. Any tokens in the form "{n}", where n is an integer, will be replaced the value of the nth parameter.

name

Required. The name attribute uniquely defines the name of the extended type. If two extended types use the same name, then the one that is loaded second will override the one that was loaded first. The name is not used in any C++ code, and does not need to be a valid C++ identifier. However, it is used as the persisted form of an argument's type, and therefore can never be changed.

cppType

Required. This attribute must contain the name of the extended type, as it will be written in C++ code, e.g. "double", "std::string", "MyNamespace::MyClass".

excelType

Required. This attribute must contain Excel's representation of the type. It must be one of: Boolean, Double, String, Short, UShort, Int.

optionalAllowed

If this attribute is set to true, then arguments of this type may be omitted, and arrays of this type may have their empty cells filled with default values. Note: There must exist a parameter-less constructor for cppType in order that the code generated for optional arguments compile successfully.

headerFiles

The headerFiles attribute contains a list of the header files that are needed in order for the code inserted by this extended type to compile correctly. This list should include the file where th converterType class is declared. The file name should not be surrounded by quotes or <...>. Multiple file names can be used, and should be separate by semi-colons, e.g. "myfile.h;..\inc\otherfile.h". Each file will be inserted as a local file if ignoreLocalHeaders is false, e.g. #include "myfile.h", and as a global file if ignoreLocalHeaders is true, e.g. #include <myfile.h>.

ignoreLocalHeaders

The ignoreLocalHeaders attribute controls whether the list of header files contained in the headerFiles attribute will be treated as local or global header files. Each file will be inserted as a local file if ignoreLocalHeaders is false, e.g. #include "myfile.h", and as a global file if ignoreLocalHeaders is true, e.g. #include <myfile.h>.

Element Information

Number of occurrences

Unlimited

Parent elements

ScalarTypes 

Child elements

LocalizedDisplayName  LocalizedDescription  Parameters 

See Also

XLL+ Extensions Schema