Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
IsNumeric - VFP analogue?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00307922
Message ID:
00308136
Views:
44
>>George,
>>
>>Nope that is not what it means, because;
>>
>>lnVar = 123
>>lcVar = "lnVar"
>>TYPE(lcVar) = "N" && The data type for lnVar
>>TYPE("lcVar") = "C" && The data type for lcVar
>>The string in lcVar is evaluated and the resultant data typoe is returned.
>>
>>This is logically the same as;
>>
>>lcVar = "123"
>>TYPE(lcVar) = "N" && The data type for "123"
>>TYPE("lcVar") = "C" && The data type for lcVar
>>
>>Think of it this way and see it clears up, type function says "What is the type of the thing in this expression?" The expression must be a character type and it is evaluated and the type of the thing in the character expression is returned.
>
>Jim,
>
>I see your point. Further, I think we're in agreement here on what's happening. However, my point wasn't whether or not this works, but whether or not the documentation coincides with that behavior. Clearly, it states that memory variables should be surrounded with quotation marks. Further, it goes on to say that if you don't "U" is returned. That fact that in your example above not doing so returns "N" contradicts the docs.
>
>Personally, I think that this should be passed on to the documentation team. I would hope that you'd be in agreement.

I hate to do this, but I agree. TYPE() accepts a character string as input, EVAL()s the string, and returns the type of the EVAL(). The behavior you're talking about is the behavior of VARTYPE()

MAGIC = 42
A = "MAGIC"
? TYPE("A") && C
? TYPE(A) && N - the type of its expansion/evaluation
? VARTYPE(A) && C
? VARTYPE(&A) && N

This is exactly as the documentation states.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform