Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Looping through grid fields
Message
 
 
To
08/11/2001 15:50:55
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00579365
Message ID:
00579370
Views:
21
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform