>Can someone, help me understand the for each command, (I think I am reading to much into it)
You may be. The command applies only to arrays and collections (which are basically arrays of objects)
Every form has a collection of controls which are contained in the form. You can create a loop that cycles through all of them like this:
FOR EACH oobj IN THISFORM.controls
IF vartype(oobj.enabled)<>"U"
[Do something with it]
ENDIF
ENDFOR
A useful method supported by FORMS is the SetAll method. Look up SetAll
in your VFP online help and play around with it a little. Look at the examples in the help and notice which types of controls support SetAll. It's a pretty useful initialization tool to use in the Init method of your form.
You can also use FOR EACH to cycle through arrays.
local a(5)
a(1)='10'
a(2)='Eleven'
a(3)='12welve'
a(4)='thoideen'
a(5)='quinze'
for each cchar in a
? cchar
endfor
Hope this helps
"The Iron Fish: The water is cold...but the fish don't mind"
...Jay Jenks, boyhood chum