>Yes, but the problem becomes how to access them after creating them. In an Array I can use a For loop to quickly iterate through all the controls to find the connection I need. If I use NewObject or AddObject, then I have to use some sort of MacroReplacement scheme to be able to iterate through each individual object. Seems a little more cumbersome...
>
>Obviously if it the "only" way then so be it, but I can't believe that there is no way to make an array of this object. Ic can be done in other languages...why not FoxPro...?
Ben,
In array you create and hold the reference to object, right? What I say is:
Instead addobject/newobject, still have your array, but this time you store full reference to object as a string. ie:
with thisform
.AddProperty('aWinsock[5]')
for ix=1 to 5
lcName = "myWinsock"+padl(m.ix,3,'0')
.NewObject(m.lcName, 'myWinSockClass', 'myWinSockClassLib')
.aWinsock[m.ix] = "thisform."+m.lcName
endfor
endwith
Code looping array would do soemthing like:
with evaluate(thisform.aWinsock[3])
.SomeProperty = somevalue
.SomeMethod()
endwith
Cetin