Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Question about referencing objects
Message
 
 
To
12/01/2001 15:29:40
Chris Laffoon
Florists' Interlink, Inc.
Paragould, Arkansas, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00463214
Message ID:
00463220
Views:
20
You can use the Evaluate function to get an object reference to it.

lcNewObjectName = 'cntMenu' + ALLTRIM(STR(MenuItems.Key))
obutton = evaluate('THISFORM.'+ lcNewObjectName)

Now you have an object reference to the button.

>I am wanting to be able to add some command button objects 'on the fly' in one of my forms, and give each one a name based on a value in my table.
>
>For example,
>
>DO WHILE NOT EOF()
> lcNewObjectName = 'cntMenu' + ALLTRIM(STR(MenuItems.Key))
> THISFORM.AddObject(lcNewObjectName, 'commandbutton')
> SKIP
>ENDDO
>
>
>My question is: how can I reference these new objects without 'hard-coding' the names of each object?
>
>Thanks for any insight!
>Chris
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Reply
Map
View

Click here to load this message in the networking platform