It's gotta be this.CreateObject(), I think. Otherwise it won't be a control
owned by the form. I dpn't think this.CreateObject() returns anything.

Containers don't have a CreateObject() method, they only have AddObject() and NewObject().

1. You could issue DODEFAULT(Parms...) in one of those methods and then add code to that method to return a reference to the object added:

PROCEDURE AddObject()
     PARAMETERS cName, cClass, Init1, Init2, ...

     DODEFAULT(cName,cClass,Init1,Init2...)

     RETURN THIS.&cName.
ENDPROC


2. You could, as suggested, manipulate the object immediately after it's added:

THIS.AddObject("oBlah","ClassBlah")

WITH THIS.oBlah
....etc.
ENDWITH

3. You could increment a counter property on the container object and concatenate its value to the name of the object when you add it, so you will always be able to find the most recently-added object by the appended digit(s).

PROCEDURE AddObject
     PARAMETERS cName, cClass, Init1, Init2, ...

     NODEFAULT

     cName = TRANSFORM(THIS.ObjectCounter) + cName

     THIS.ObjectCounter = THIS.ObjectCounter + 1

     DODEFAULT(cName,cClass,Init1,Init2...)
ENDPROC

4. You could do number 3, above, using a timestamp instead of a number.

Ken Dibble
www.stic-cil.org


-Lew Schwartz


On Wed, Apr 9, 2014 at 4:32 PM, Allen <[email protected]> wrote:

> If there are many can you use createobject? Then you have your reference
> Al
>
> -----Original Message-----
>
> Guess I should have added that there will be many image controls on this
> form. I need a way to work with the most recently added one individually.
>
>
[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to