>Hi.
>
>I want to create a procedure that can create objects from classes like this:
>
>procedure createObject
>lparamaters lcClassName, lcObjectName
> this.oMyObject = createobject(lcClassName)
> with this.oMyObject
> .enabled = .t.
> endwith
>endproc
>
>So, I got that far (...)
>
>If lcObjectName had the value of oNewObject how do I
>replace this.oMyobject with this.oNewObject
>
>tia, and merry ... to you all!
>
>Victor
Victor,
Isn't this a duplication of createobject() or newobject(). If you could provide why you need to do it we can have better ideas. Macro substitution and eval() would work :
procedure createObject
lparamaters lcClassName, lcObjectName
this.&lcObjectName = createobject(lcClassName)
with evaluate('this.'+lcObjectName)
.enabled = .t.
endwith
endproc
Cetin