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:
00190016
Vues:
18
I see. Thanks.

Take care,
Joe


>Joseph,
>
>No the assign method actually does the assignment of the value to the property. Assign methods receive a parameter named vNewVal which has the vlaue being assigned in it. When you create an assign method it starts out like this;
>
>
>LPARAMETERS vNewVal
>* To do: ...
>
>THIS.PropertyName = vNewVal
>
>
>So for the RGB example we could;
>
>
>* Outside code
>Thisform.BackColor = "Light Grey"
>
>* Form's BackColor assign method
>LPARAMETERS vNewVal
>
>DO CASE
>   CASE vNewVal = "Light Grey"
>      This.BackColor = RGB(192,192,192)
>   CASE vNewVal = "Blue"
>      This.BackColor = RGB(0,0,255)
>   ...
>ENDCASE
>
>
>This code will allow other code to assign a backcolor to the form using the color's name in English and simply assigning the name to the backcolor property. The assign method fire and can handle the conversion of the color name to the appropriate RGB() function call.
>
>The access methods work similarly, for example;
>
>
>* Form Backcolor access method
>LOCAL lcReturn
>DO CASE
>   CASE Thisform.backcolor = RGB(192,192,192)
>      lcReturn = "Light Grey"
>   CASE Thisform.backcolor = RGB(0,0,255)
>      lcReturn = "Blue"
>   ...
>ENDCASE
>RETURN lcReturn
>
>
>In this case code that;
>
>?Thisform.backColor
>
>will return "Light Grey" or "Blue" or whatever.
Joseph C. Kempel
Systems Analyst/Programmer
JNC
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform