Bob,
If you store the name you can convert it to an object reference with eval:
this.cAddedObjectName = sys(2015)
local loObject
loObject = eval( this.cAddedObjectName )
with loObject
.Height = 10
endwith
If you store object references as Kamal suggests, you need to make sure you get rid of the reference by setting it to .null. or your form won't properly destruct.
>Say I have a class that adds an object to a form. How do I generate and reference a unique object name?
>
>Example:
>If the object method does:
>THISFORM.AddObject("bob", "Line")
>then this might be bad because "bob" may already exist
>
>Do I do something like:
>THIS.cAddedObject = SYS(2015) && init my reference to added object
>THISFORM.AddObject(THIS.cAddedObject, "Line") && add the object
>
>And if this is right, then how do I de-reference it?
>THIS.cAddedObject.height = 10
>gives an error because THIS.cAddedObject is a string not an object.