Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Triy to use macro substitution for object.property
Message
From
06/08/1999 18:17:41
 
 
To
06/08/1999 18:12:14
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00250948
Message ID:
00250954
Views:
21
The big-picture question is why aren't you just:
THISFORM.MyObj2.ENABLED = THISFORM.MyObj1.Option1.VALUE
I suspect there is more to this than you've explained in your example.

The other thing that's weird is the "ENABLED()". Leave the parentheses off the "ENABLED" since it's not a method and is a property. Note that you can also do this:
STORE llResult TO (cSomeString)
If you want to avoid a macro expansion.



>Hello,
>I would need to execute a code like this:
>
>llResult = EVALUATE("THISFORM.MyObj1.Option1.VALUE = 1")
>lcString = "THISFORM.MyObj2.ENABLED()"
>&lcString = llResult
>
>However, I get a syntax error in line three. Is it not possible to refer to an object like this? The llResult is working (returns .T. or .F.).
>Is there another way of doing this?
>The reason I try to use two variables is, that I have to use something like
>
>FOR ii = 1 TO 12
>and ALLTR(STR(ii)) is added to MyObj, so I can refer to 12 Objects with one simple code instead of writing a lot of repeated lines.
>Any Ideas?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform