>This is interesting. My last lines didn't get included in your reply...strange. I must have updated my message (left out that last couple of lines when I cut and pasted) at the same time you posted yours?
>
Perhaps. Right now I was updating my own reply (wanted to add, that if you need to invoke a method, you need to use evaluate).
Anyway, let me re-read your original question to see what I missed.
>
>>I use STORE command and name expression for such manipulations. The only place for macro here, which I don't see a way to avoid, is PUBLIC declaration.
>>
>>For everything else:
>>
>>store createobject('ConnClass.ConnObj') to (m.lcConn)
>>store TRIM(mytable.cserver) to (m.lcConnServer)
>>
>>etc.
>>
>>
>>>Maybe I am just slow this Monday morning. If I want to create an object reference on the fly and set the values of its properties (Object will be public not local):
>>>
>>>For example:
>>>
>>>* Table with values to use for object's properties
>>>* Mytable.cname && cName will become part of object's name
>>>* Mytable.ctype && cType will become part of object's name
>>>* Mytable.cserver && cServer will be the object's pServerName value
>>>* Scan through the table 'mytable' and create an object from each record
>>>
>>>
>>>lcConn = "'o'+mytable.cname+'_'+mytable.ctype
>>>PUBLIC &lcConn
>>>&lcConn = CREATEOBJECT('ConnClass.ConnObj')
>>>lcConnServer = lcConn + '.pServerName'
>>>&lcConnServer = TRIM(mytable.cserver)
>>>
>>>or
>>>
>>>&lcConnServer..pServerName = TRIM(mytable.cserver)
>>>
>>>or
>>>
>>>loControl = EVAL(lcConn)
>>>lControl.pServerName = TRIM(mytable.cserver)
>>>
>>>
>>>Or is there a better way? Which will be fastest if I have to create 10 similar objects with 10 properties each sequentially? Which will be easiest to maintain (by other developers)?
If it's not broken, fix it until it is.
My Blog