>I was planning on creating the array as a form property. I guess I was a little unclear in my explanation. The text box objects already exist on the form. I want to store references to them in the array so that I can easily get back to them later. I really want to say "aArray[nPtr] = THIS". I know I can't do that though. Then later I could say aArray[nPtr]. = .
Believe it or not, this works great for me.
1. Create an array as a form property.
2. Using ThisForm, or a reference thereto, simply use: ThisForm.Addobject(cFormArrayElemName,cClassName)
To build the object name:
Assume your form property array is called aTxtBoxes, and that you are loopwise instantiating textbox objects and assigning a reference for each textbox to the nth element of the property array:
* Build the character string that holds the literal expression for the array element:
cNewTxtBoxElem="aTxtBoxes("+allt(str(n))+")"
* Instantiate the textbox
ThisForm.AddObject(cNewTxtBoxElem,"TextBox")
And there's your control array. I find it easier to subclass the textbox, even if I change nothing from the base class, so that I can slam the subclass with SetAlls and not effect other textboxes on my form.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only