Skip to content

TypeOf

Include: Use System\Reflection.pkg

See Also: DfType, StructTypeOf, ArrayTypeOf

Purpose

Returns the DfType constant for a value.

Syntax

Function TypeOf Global Variant vVar Returns DfType

Arguments

vVar : Value to inspect.

Returns

A DfType constant such as C_TypeString, C_TypeInteger, C_TypeArray, C_TypeStruct, or C_TypeNone.

Behavior

Uninitialized Variant values return C_TypeNone. Scalar, struct, and array values return their runtime type.

Example

Variant vValue
DfType eType
String sName
Integer iId

Get TypeOf vValue to eType
// eType is C_TypeNone

Move "Ada" to sName
Get TypeOf sName to eType
// eType is C_TypeString

Move 42 to iId
Get TypeOf iId to eType
// eType is C_TypeInteger