>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