Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP6 Tip-o-the-day
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00117727
Message ID:
00117743
Views:
15
>Folks,
>
>Remember the hassles wehn you forgot the quotes when using the TYPE() fucntion. Well, you can forget them in VFP6 and use the VARTYPE() function instead. The following code shows both the TYPE() and VARTYPE() functions doing the same thing;
>
>
>MyVar = "ABC"
>
>? TYPE("MyVar") && displays C
>? VARTYPE(MyVar) && displasy C
>
>Var1 = "ABC"
>Var2 = "DEF"
>
>?Type("Var1+Var2") && displays C
>? VarType(var1+var2) && displays C
>
>
>
>The help file even says that VarType() is faster than Type(). Since Type() is one of the most time consumming of the VFP functions, it is nice to have faster alternative.
>
>There are still some situations where you will need to use the Type() function. If you have a memory variable that contains the name of something else whose data type you want to know, you must use the Type() function. For example;
>
>
>Var1 = 123
>Var2 = "Var1"
>
>? TYPE(Var2) && Displays N because Var1 is numeric
>? VarType(Var2) && displays C because Var2 is character
>
>
And a "tip-o-the-hat" to you (and JVP and John K) for posting these tips Jim.
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform