Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting the type of a field
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00529271
Message ID:
00529309
Views:
11
>>>>>>I have an array which contains the name of some fields in my table. From that array, I would like to extract the type of the field. Is there a way to do that from the array?
>>>>>
>>>>>
>>>>>? type(myfields(i))
>>>>>
>>>>
>>>>That returns N even if my field type is I.
>>>
>>>Why not use AFIELDS() find the matching field name and get the data type from column 2?
>>
>>Yes, that seems to be the only solution to do. But, why TYPE doesn't work on integer?
>
>Don't know, but it's documented that TYPE() and VARTYPE() return N for Numeric, Integer, Double, and Float datatypes.

Help says (in "Data and Field Types"):

In addition, Visual FoxPro provides data types that apply only to fields in tables. and lists Double, Float, General, Integer, Memo and their variations.
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Reply
Map
View

Click here to load this message in the networking platform