Article ID: 139863
Article Last Modified on 2/10/2000
FUNCTION ALLTYPE
*
* Purpose: Determine the data type of a variable
* Syntax: m.cNewValue = ALLTYPE(<Variable Name>)
* Parms: xxx (Can be Character, Numeric, Date, or Logical)
* The variable for which the type is to be determined.
* Return: lcType: C for Character
* N for Numeric
* D for Date
* L for Logical
* Example: lcTheType=ALLTYPE(Variable)
*
PARAMETER xxx
local llType,lcType
lcTemperror=ON('ERROR')
ON ERROR llType=.f.
llType=.T.
xxx=xxx+" "
IF llType
lcType="C"
ENDIF
llType=.T.
xxx=!xxx
IF llType
lcType="L"
ENDIF
llType=.T.
xxx=xxx+1
IF llType
lcType="N"
ENDIF
llType=.T.
xxx=MONTH(xxx)
IF llType
lcType="D"
ENDIF
ON ERROR &lcTemperror
RETURN lcType
? TYPE('x')
Additional query words: VFoxWin
Keywords: kbcode KB139863