Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Addobject(), then reference it
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00194785
Message ID:
00194788
Vues:
24
Sorin,
>lcObj = "obj" + ALLTRIM(STR(counter))
>=Addobject(lcObj , "objclass"),


loObj = eval( "this." + lcObj )
with loObj
   .Property = value
endwith
>I've always used to add objects with names built programmaticaly (like obj1, obj2, etc.) as follows:
>lcObj = "obj" + ALLTRIM(STR(counter))
>=Addobject(lcObj , "objclass"),
>then to reference it i do this:
>lcObj = "This.objname"
>loObj = &lcObj, and further reference loObj...
>I wonder if there is a better way to reference the newly added object, than macro substitution
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform