Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Addobject(), then reference it
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00194785
Message ID:
00194788
Views:
22
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform