Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
FIELD( ) Function - NOT!
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00316885
Message ID:
00317205
Vues:
16
>Is there a command the returns the opposite result of FIELD() Function? Because FIELD() returns the name of a field, referenced by number, in a table.
>
>I am looking for a function that returns the number of a field, referenced by name, in a table. Any such thing?
>
There's no native function to do this, but it'd be easy enough to extract the list of fields to an array using AFIELDS(), and then look for the field name in the array using ASCAN, which would give you the field number corresponding to the name.

Another approach would be to populate a Scripting.Dictionary object (part of the WSH) with the list of fields and their relative positions. You can search a Scripting.Dictionary object by item name.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform