Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Object references
Message
De
22/09/2006 14:43:41
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01156578
Message ID:
01156594
Vues:
15
Thanks guys. I screwed up. Actually the construct I used for my example does work. The one that failed used eval() rather than the ¯o. I sometimes get them confused. Your suggestions however are probably better. Thanks again.
- Don

>
>propertyvalue = GETPEM(oObject, "P" + transform(i))
>STORE somevariable TO ("oObject.P" + transform(i))
>
>>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?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform