Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Properties
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00189168
Message ID:
00189987
Vues:
13
I am asking specifically about the order of execution.

I would have thought that the command
ThisForm.BackColor = rgb(255,0,0)
would first execute (ie. set the BackColor property of the from), then run the ASSIGN method of the form.

Is this accurate? This is really my question.

If the above is accurate, then similarly the command
ThisForm.BackColor = "RED"
would first execute (ie. produce an error), then run the ASSIGN method of the form.

If the above is not accurate, then I assume if you say
ThisForm.BackColor = rgb(255,0,0)
the property may or may not be set depending on what code is in the form's assign method. In other words, the ASSIGN method intercepts the command. It appears to me that this is the case. I just can't test it myself.

Thanks,
Joe

>>Just an observation:
>>If I understand correctly, if the Assign method affects other objects, it could prove to be a tricky bug to find for someone who is not aware of the method.
>>
>>I do have a question:
>>The example you gave,
>>ThisForm.BackColor = "RED"
>>would produce an error in VFP 3.0 (improper data type or something). Would the Assign method intercept the assignment command and actually override what it does and therefore avoid the error?
>>
>>Also, does every propery of every object have Assign and Access methods?
>>
>
>Joe,
>
>If a developer uses an assign emthod then that developer should be aware of how they work. Assign and access methods are optional in VFP 6.0. You can have them or not as you choose.
>
>An assign method receives the value being assigned as a parameter and you can do whatever you want with it. Yes, the code would cause an error in 3.0 cuz 3.0 doesn't have assign method support, neither does 5.0.
>
>You can create access and assign methods for any property you choose, your own custom ones and the one that are part of the VFP base classes.
Joseph C. Kempel
Systems Analyst/Programmer
JNC
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform