Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Should Assign Method Fire?
Message
 
À
30/11/2001 07:15:23
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00587499
Message ID:
00587974
Vues:
31
>>>>Why does the assign method fire when a property with an assign method is used in a math expression on the right side of an assignment statement? This happens in VFP 6 and 7.
>>>>
>>>>DEFINE CLASS MyCLASS as Custom
>>>>	PROCEDURE height_assign
>>>>		LPARAMETERS vNewVal
>>>>		*To do: Modify this routine for the Assign method
>>>>		THIS.Height = m.vNewVal
>>>>		WAIT WINDOW "Assignment fired - value "+ STR(vnewval)+".  Press any key to continue.."
>>>>	ENDPROC
>>>>ENDDEFINE
>>>>
>>>>* Test program to show anomally
>>>>PROCEDURE test
>>>>
>>>>* create class
>>>>o = CREATEOBJECT("myclass")
>>>>* Wait window should appear in assign method
>>>>o.height = 1
>>>>* wait window should not appear in assign method
>>>>y= o.height+2
>>>>
>>>>Return
>>>>
>>>
>>>Just been playing, happens for width, top & left too
>>
>>Thanks... I will pass that along to the MS guys
>
>Nor is it limited to custom classes, I get similar effect with classes based on Command buttons & Edit boxes too.

I asked Mike Stewart of MS to take a look, and have received no response... I'll try and let you know when they get back with me about it.
Wayne Myers, MCSD
Senior Consultant
Forte' Incorporated
"The only things you can take to heaven are those which you give away" Author Unknown
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform