Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Question about referencing objects
Message
 
 
À
12/01/2001 15:29:40
Chris Laffoon
Florists' Interlink, Inc.
Paragould, Arkansas, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00463214
Message ID:
00463220
Vues:
18
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform