Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Variable Object Reference Without Macros- VFP 5
Message
De
23/03/2004 17:05:08
 
 
À
23/03/2004 15:10:08
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00888990
Message ID:
00889043
Vues:
30
Ah, knew there had to be a better way!
Perfect, thanks!

>Bill,
>
>
...	
>        loObj = EVALUATE("thisform."+obj_name)
>	WITH loObj
>		.Top = (a*19)
>		.Visible = .T.
>		...
>	ENDWITH	
>
>>Hi All,
>>
>>I have a loop which adds objects to a form in the form's INIT event. Is there a way to reference the objects within the loop to adjust their properties (the loop round is part of the property value,) without using macros? The code below works, but, yuch!
>>
>>
>>FOR a=1 TO mn_tot_periods
>>	obj_name='period'+ALLTRIM(STR(a))
>>	THISFORM.ADDOBJECT(obj_name,'day_act_shape')
>>
>>	clunky_macro1 = "thisform."+obj_name+".top"
>>	&clunky_macro1 = (a*19)
>>
>>	clunky_macro2 = "thisform."+obj_name+".visible"
>>	&clunky_macro2 = .T.
>>ENDFOR
>>
>>
>>Thanks!
Bill Leber
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform