Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
FIELD( ) Function - NOT!
Message
De
12/01/2000 09:18:58
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00316885
Message ID:
00316900
Vues:
19
>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?
>
>The reason is that I have a group of 40 fields in the middle of my table and I have to check them all for a certain value. But I want to start checking at say field #30 and check until I get to field #70 for a common value. All fields are character 1.
>
>I figure if I determine the starting field number, I can loop through the fields until I reach the ending field number. And if I do the loop based upon field numbers, I would not care if additional fields were ever added in between the exisiting fields as long as they were Char 1 and used for the same purpose as the other 40 fields surrounding them.
>
>What do you think? Thanks for a clue.


lcField = "myField"
for ix = 1 to fcount()
  if field(ix) = upper(lcField)
     exit
  endif
endfor

for jx = ix to fcount()
  ...
endfor
I don't knwo of a function just doing the opposite.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform