General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Fine, Doug. So wouldn't you expect, based on all that, that it would return "U" for VARTYPE(obj.property) if obj doesn't exist???
I learned (from Mr. Levy, who wrote the thing) that it is not intended to handle this "by design" and I accept that. What I still cannot accept is that the documentation doesn't say so. If I've missed it in what you've reprinted (which looks the same as my Help), then please show me the light.
Cheers,
Jim N
>Jim,
>
>>>I explained my opinion ti tis fullest in the post you are referring to, and I won't beat the horse now, but I will simply restate: If you are getting an error with VARTYPE, then you are using it for something it was not designed for.
>
>>Yep, it's just that we are not told what it is (or isn't designed for.
>
>
>Hello! Maybe I've missed something but the help file _does_ tell us what the VARTYPE() funtion is for.
>
>The VFP helpfile says:
>
>"Returns the data type of an expression." <<--- !!!! Here it is. Followed by:
>
>"Syntax
>
>VARTYPE(eExpression [, lNullDataType])
>
>Returns
>
>Character
>
>Arguments
>
>eExpression
>
>Specifies the expression for which the data type is returned. VARTYPE( ) returns a single character indicating the data type of the expression. The following table lists the characters that VARTYPE( ) returns for each data type:
>
>Character returned Data type
>C Character or Memo
>N Numeric, Integer, Float, or Double
>Y Currency
>L Logical
>O Object
>G General
>D Date
>T DateTime
>X Null
>U Unknown
>
>
>Note If eExpression is an array, the first element in the array is evaluated.
>
>lNullDataType
>
>Specifies if VARTYPE( ) returns the data type when eExpression contains the null value. If lNullDataType is true (.T.), VARTYPE( ) returns the data type of eExpression. If lNullDataType is false (.F.) or omitted, VARTYPE( ) returns 'X', indicating that eExpression contains the null value.
>
>Remarks
>
>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.
>
>VARTYPE( ) returns “U” if you specify a variable that doesn’t exist."
>
>Best,
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only