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:31:09
 
 
To
06/08/1999 18:17:41
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00250948
Message ID:
00250962
Views:
24
Hi Nancy,
You were right with the "()", they were the syntax error.
It's working fine.
Here's the code:

LOCAL ii, mi
FOR ii = 1 TO 12
FOR mi = 1 TO 5
lcStrin='THISFORM.ClickF'+ALLTR(STR(ii))+'.Btn'+ALLTR(STR(mi))+'.ENABLED'
llResult = EVALUATE("THIS.Chk" + ALLTR(STR(ii)) + ".VALUE") = 1
&lcString = llResult
ENDFOR
ENDFOR
So I can set 5 times 12 different objects with one click (60 buttons).
What do you think of that?

>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?
Christian Isberner
Software Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform