Dear Foxers:
I sometimes have a "reference" to an object that is in the form of a string variable. I have used &reference..referredto
Is there a better way of doing this?
(reference).referredto would be nice, but it does not compile.
Sincerely,
Gene Wirchenko
Cast it to a string comes to mind but VFP will let you change the value of a type in a heartbeat.
&reference..referredto.ToString()
On Thu, Feb 15, 2018 at 12:51 PM, Gene Wirchenko genew@telus.net wrote:
Dear Foxers:
I sometimes have a "reference" to an object that is in the form of astring variable. I have used &reference..referredto
Is there a better way of doing this? (reference).referredtowould be nice, but it does not compile.
Sincerely,
Gene Wirchenko
[excessive quoting removed by server]
Hi Gene:
To talk with an example, if you have this:
oObj = createobject("custom") reference = "oObj"
The you have at least 3 options:
1) The way you know => &reference..referredto
2) Using evaluate => =Evaluate(reference + ".referredto")
3) My preferred: Caching the object and then using it:
oRef = Evaluate(reference) ? oRef.refered1 ? oRef.refered2 ...
2018-02-15 19:51 GMT+01:00 Gene Wirchenko genew@telus.net:
Dear Foxers:
I sometimes have a "reference" to an object that is in the form of astring variable. I have used &reference..referredto
Is there a better way of doing this? (reference).referredtowould be nice, but it does not compile.
Sincerely,
Gene Wirchenko
[excessive quoting removed by server]