Field-Map Scripting

4.1.10.8 VarType

VarType function


Prototype:

function VarType(const Data :variant) :word;

Description:

Returns the type code of a specified Variant

Syntax:

variable:= VarType(Data);


Part

Description


variable

variable declared as a word


Data

variable declared as variant

Return value:

type code of a specified Variant


Note: This function is available since version X7.


The following table describes the meaning of each of the variant types defined in the System unit:


Variant Type

Description

varEmpty

The variant is Unassigned.

varNull

The variant is Null.

varAny

Represents a Variant that can hold any value.

varSmallint

16-bit signed integer (type Smallint in Delphi, short in C++).

varInteger

32-bit signed integer (type Integer in Delphi, int in C++).

varSingle

Single-precision floating-point value (type Single in Delphi, float in C++).

varDouble

Double-precision floating-point value (type double).

varCurrency

Currency floating-point value (type Currency).

varDate

Date and time value (type TDateTime).

varOleStr

Reference to a dynamically allocated UNICODE string.

varDispatch

Reference to an Automation object (an IDispatch interface pointer).

varError

Operating system error code.

varBoolean

16-bit Boolean (type WordBool).

varVariant

Indicates another variant.

varUnknown

Reference to an unknown object (an IInterface or IUnknown interface pointer).

varShortInt

8-bit signed integer (type ShortInt in Delphi or signed char in C++).

varByte

A Byte.

varWord

Unsigned 16-bit value (Word).

varLongWord

Unsigned 32-bit value (type LongWord in Delphi or unsigned long in C++).

varInt64

64-bit signed integer (Int64 in Delphi or __int64 in C++).

varStrArg

COM-compatible string.

varString

Reference to a dynamically allocated string (not COM-compatible).

varArray

Indicates a Variant array.

varByRef

Indicates that the variant contains a reference as opposed to a value.

varTypeMask

Indicates the type of each array element.




See also:

SetArrayLength; GetArrayLength; VarArrayOf; VarArrayCreate; VarArrayDimCount; VarArrayLowBound; VarArrayHighBound; VarType; VarIsArray; VarIsNumeric; SetVarArrayValue; GetVarArrayValue