Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Code to search a table for a value and return fieldname
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00193342
Message ID:
00193348
Vues:
15
>>What would be a Code to search a table for a value and return the fieldname containing that value, (perhaps multiple fieldnames, perhaps multiple records)?
>
>start with:
>llFound = .f.
>for i = 1 to fcount()
>  if type(field(i)) = "C"
>     if somevalue $eval(field(i))  && might want to use upper() on both
>        llfound = .t.
>        exit
>     endif
>  endif
>next
>if llFound
>   return field(i)
>else
>   return .null.
>endif
sorry. To search the table:

locate for somevalue $eval(field(i))
if !eof()

etc...
Mark McCasland
Midlothian, TX USA
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform