>How do I create a control array on a form ?
>the foxpro help just defines control array, does not give examples.
>
>In Visual Basic, when I make a copy of a control, it asks me if I want to create a control array.
The
Hacker's Guide to Visual FoxPro has this to say about controls arrays:
"Our take is that control arrays were part of the original design of the object model to let you do things like group command buttons. The idea is that each element of an array is a reference to a different object. You can define methods for the array and apply them to the individual members. This would let you, for example, have one Click method that responds to a click on any object referenced in the array. The nIndex parameter tells you which one.
Sounds pretty neat, and it is similar to things we tried when simulating toolbars in FoxPro 2.x. But the CommandGroup and OptionGroup base classes do pretty much the same thing (though slightly differently).
We suspect that once the design team made it easy to group buttons, control arrays didn't seem quite so urgent, because the team never really finished implementing them. You can create control arrays in coded classes, but not in the Class Designer. The way you have to do things to make them work feels really kludgy."
It then goes on to describe some serious bugs in the implementation of control arrays. I recommend the
Hacker's Guide, available at
www.hentzenwerke.com and possibly at a discount to PUTMs.
I personally haven't used control arrays and generally find vfp's built in collections sufficient for most of my needs. I'm not sure when you would need one.