Skip to main content

DataType function (LotusScript Language)

Returns the data type of the value of an expression.

Syntax

DataType ( expr )

VarType is acceptable in place of DataType.

Elements

expr

Any expression.

Return value

DataType returns a number representing the data type of expr.

The following table describes the possible return values. The first column is the return value. The last column is "Yes" if the return value applies to variants only.

ReturnValue typeConstantVariants only
0EMPTYV_EMPTYYes
1NULLV_NULLYes
2IntegerV_INTEGER
3LongV_LONG
4SingleV_SINGLE
5DoubleV_DOUBLE
6CurrencyV_CURRENCY
7Date/TimeV_DATEYes
8StringV_STRING
9OLE object or NOTHINGV_DISPATCHYes
10OLE errorV_ERRORYes
11BooleanV_BOOLEAN
12Variant list or arrayV_VARIANT
13IUNKNOWN (OLE value)V_IUNKNOWNYes
17ByteV_BYTE
34User-defined objectV_LSOBJ
35Product objectV_PRODOBJ
2048List
8192Fixed array
8704Dynamic array

Usage

The file lsconst.lss defines the constants described in the preceding table. If you want to refer to the return values as symbolic constants instead of numbers, use the %Include directive to include this file in your script.

If the argument to DataType is a list or an array, the return value is the sum of the value that represents a list or an array plus the value that represents the data type of elements of the list or array. For example, a fixed array of Integers is 8194 (that is, 8192 + 2); a list of Variants is 2060 (that is, 2048 + 12).

The return value 13 signifies an unknown value type, corresponding to the OLE value IUNKNOWN. To test for this value, use the IsUnknown function.

IsObject

IsNull

IsEmpty

IsArray

IsList

IsNumeric

IsScalar

IsUnknown

Example