Click or drag to resize

VarType Function (Usual, Logic)

X#
Returns the data type of an expression.
Note Note
VARTYPE( ) is similar to the TYPE( ) function, but VARTYPE( ) is faster and does not require quotation marks to enclose the expression for which the data type is returned.

Namespace:  XSharp.VFP
Assembly:  XSharp.VFP (in XSharp.VFP.dll) Version: 2.19
Syntax
 FUNCTION VarType(
	eExpression AS USUAL,
	lNullDataType AS LOGIC
) AS STRING
Request Example View Source

Parameters

eExpression
Type: Usual
Specifies the expression for which the data type is returned. VARTYPE( ) returns a single character indicating the data type of the expression.
The table in the remarks section lists the characters that VARTYPE( ) returns for each data type.
lNullDataType
Type: Logic
Specifies whether VARTYPE( ) returns the data type when eExpression contains the null value. The table in the remarks section lists the values of lNullDataType.

Return Value

Type: String
Character. VARTYPE( ) returns a character representing the data type of the specified expression.
Remarks
Return valueData type
CCharacter, Memo, Varchar, Varchar (Binary)
DDate
GGeneral
LLogical
NNumeric, Float, Double, or Integer
OObject
QBlob, Varbinary
TDateTime
UUnknown or variable does not exist
XNull
YCurrency
Note Note
If eExpression is an array, the first element in the array is evaluated.
lNullDataTypeDescriptionTrue (.T.)Return data type for eExpression.False (.F.) or omittedReturn 'X' to indicate eExpression contains a null value.
See Also