Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting the type of a field
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00529271
Message ID:
00529299
Vues:
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?
>>>
>>>If its an array created with Afields() then the column 2 has the data type of the table column. Otherwise, you could use the TYPE() function (if the table is open.
>>>
>>>? type(MyArray[1]) && returns evaluation of the data stored in the field name stored in the table
>>
>>As mentioned in the other reply, that returns N even if the type is I.
>
>In order to get table field types, you have to use AFIELDS(). There is no variable check for these types of data types because there is no variable type of this kind. The same is true for Currency, Float, Double, etc. You need to use a function that actaully reads the table information.

Larry,

According to the docs, it (both TYPE() and VARTYPE()) works for Currency, but not the others.
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform