Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Looping through grid fields
Message
 
 
À
08/11/2001 15:50:55
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00579365
Message ID:
00579370
Vues:
22
>Hi. VFP6. I want to loop through fields 5-10 of the first record of my grid looking for matching criteria. I could write a great big Case statement, but I am thinking that a loop with macro substitition would be more efficient. The problem is that I do not know how to refer to the individual "cells" in a looping scenario.
>
>Thanks, Randy
with thisform.grd
for lnI=5 to 10
    lcField = .columns[m.lni].ControlSource
    lcFieldVal = evaluate(m.lcField)
    if "myVal" $ m.lcFieldVal
       =messagebox("Match is found in field "+ justext(m.lcField)
      exit
    endif
next
endwith
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform