Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Properties
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00189168
Message ID:
00190010
Views:
15
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform