Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Object references
Message
From
22/09/2006 14:15:20
 
 
To
22/09/2006 14:10:37
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01156578
Message ID:
01156581
Views:
11
It's the . in the macro expansion. That will stop it. Try this.
for i = 1 to 10
   objectproperty = "P" + transform(i)
   oObject.&objectproperty. = somevariable
next
>Is there a way to reference an object property indirectly? For example, suppose you have an object with properties
>
>oObject.P1 = 23
>oObject.P2 = 63
>oObject.P3 = 93
>
>
>Now we want to change these values in a for/next loop.
>
>for i = 1 to 10
>   objectproperty = "oObject.P" + transform(i)
>   &objectproperty = somevariable
>next
>
>
>The macro sub doesn't work in this case. I suppose because its on the wrong side of the equasion.
>Is there a way to do this?
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Previous
Reply
Map
View

Click here to load this message in the networking platform