Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Fields in a listbox
Message
De
24/01/2004 06:23:24
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00870195
Message ID:
00870222
Vues:
23
Hi Steve.

Is, however,there a way to return the name of that column i.e. field of the table?

That depends on what the RowSourceType is < s >. If the RowSourceType is 2-Alias, all you need to do to get the name of the field in the underlying data is this:
lcFieldName = FIELD( 2, This.RowSource )
If the RowSource is 3-Sql Statement, you can use the same logic as above, but instead of This.RowSource, you have to use the name of the cursor that is the desitination in the SELECT statement.

If the RowSource is 6-Fields, you can parse the name of the field from the RowSource. For example, if you want the second field name, you would do it like this:
lcFieldName = ALLTRIM( GETWORDNUM( This.RowSource, 2, ',' ) )
To get the name of the table when the RowSourceType is 6, use this code:
lcAlias = GETWORDNUM( This.RowSource, 1, '.' )
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform