LOTUSSCRIPT LANGUAGE


DataType function
Example

Returns the data type of the value of an expression.

Syntax

DataType ( expr )

VarType is acceptable in place of DataType.

Elements

expr


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

Language cross-reference

@IsNumber function in formula language

@IsTime function in formula language

@IsText function in formula language

Example
See Also