Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Serious BUG: TYPE(
Message
 
 
To
04/01/2005 07:04:14
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
00974039
Message ID:
00974102
Views:
27
Fabio,

It's not a bug, as others have said, it is documented to work the way it does. I'm one that is glad it works this way.

I'd guess the logic behind the design choice was to prevent everyone from having to go back and add V as a possible type test condition in their code:
do case
   case type(...) $ "CM"
      * dealing with a text item
I'm glad I don't have to ferret out all those places in all the code I maintain and change it to CMV

So yes, you'll need to use afields to get the absolute column type.

>TYPE("someField") return correct type for M,G,.....
>
>For a VarChar it return "C".
>This is documented.
>
>
>CREATE CURSOR bugbug (bug V)
>? TYPE("bug")
>
>
>Now, for knowing if a field is varchar, I must to use AFIELDS() ?
>
>WHY!!!!!!????
>Who can think one similar what?
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Reply
Map
View

Click here to load this message in the networking platform