VarType Function (Usual, Logic) | |
Returns the data type of an expression.
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.21
Syntax FUNCTION VarType(
eExpression AS USUAL,
lNullDataType AS LOGIC
) AS STRING
public static string VarType(
Usual eExpression,
bool lNullDataType
)
Request Example
View SourceParameters
- 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 value | Data type |
---|
C | Character, Memo, Varchar, Varchar (Binary)
|
D | Date |
G | General |
L | Logical |
N | Numeric, Float, Double, or Integer |
O | Object |
Q | Blob, Varbinary |
T | DateTime |
U | Unknown or variable does not exist |
X | Null |
Y | Currency |
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