Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to check the type of a parameter
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00508539
Message ID:
00510139
Views:
20
Jay,

If tcVariable = "5" it should return C.
If tcVariable = 5 it should return N.

I have solved the problem. If tcVariable is type C, I check to see if its contents are a valid variable, field or property name.
lcType = TYPE( 'tuValue' )
IF lcType = 'C' AND ( LEFT( tuValue, 1 ) = "_" OR ISALPHA( tuValue ) ) AND TYPE( tuValue ) # 'U'
  lcType = TYPE( tuValue )
  tuValue = EVAL( tuValue )
ENDIF
>>Jay,
>
>>If tcVariable = "5" then the following code will set lcType to N instead of C. It appears that TYPE tries to evaluate uMyVar then returns the type of the result.
>
>>Shane
>
>Precisely. What do you want it to return in this case?
>
> Jay
Shane Murdoch
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform