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:
00508846
Views:
21
Kurt,

This does not work if uMyVar contains the name of a variable that contains a numeric value. If uMyVar equals "3", ".T." or "{^2001/01/01}" then TYPE("&uMyVar") or TYPE(uMyVar) returns N, L or D instead of U. This is the problem that I have. It appears that TYPE tries to evaluate uMyVar then returns the type of the result.

Any ideas,

Shane

>Here you go....
>
>The only drawback to this is that the parameters passed cannot be declared as local in the calling procedure
>
>PROCEDURE cMyFunc( uMyVar )
>
>IF TYPE('uMyVar') = 'C' AND NOT INLIST(TYPE(uMyVar),'U','N')
> cReturnValue = TYPE(uMyVar)
>ELSE
> cReturnValue = TYPE('uMyVar')
>ENDIF
>RETURN cReturnValue
>ENDPROC
>
>
>Kurt
Shane Murdoch
Previous
Reply
Map
View

Click here to load this message in the networking platform