>>Use EVAL() to turn the name of an object into an object reference:
>>
>>
oSavedObject = EVAL(m.tcObjectName)
>>
>>You probably want to wrap that in TRY-CATCH in case the object doesn't exist.
>>You can then use EVAL again to reference the property:
>>
>>
>>STORE m.tuValue TO EVAL("m.oSavedObject." + m.tcProperty)
>>
>>
>>Of course, it's easier to just pass the object in the first place.
>
>Sorry, no! Treat your CPU well!
>store m.toValue to (m.tcObjectName + "." + m.tcProperty) is enough, no need for 2 eval() calls - perhaps try catch, but nothing else
>If oSavedObject = EVAL(m.tcObjectName) works, as the name is in scope and not somewhere in a hierarchy, the store will work as well, provided the property exists
> ;-)
Actually
oSavedObject = EVAL(m.tcObjectName)
addproperty(oSavedObject, tcProperty, tuValue)
...should always work, except in some cases when property is protected or hidden - and checking for that is a good enough reason to make this a method or procedure. Otherwise, addproperty() would do the same without any need to call a method/procedure. Handling the case when we don't want to create a property if it didn't already exist is another reason.