Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to set a variable to a property?
Message
From
01/04/2021 13:14:29
Mike Yearwood
Toronto, Ontario, Canada
 
 
To
01/04/2021 13:01:43
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
01679404
Message ID:
01679442
Views:
43
>>>Dimitry, I'm not saying that this will work as you intend, but, to assign the content of the variable cTest to a user defined property in the the property window, you should input = m.cTest (verbatim, starting with the equal/assignment symbol). Otherwise, VFP will store the value "cTest" or "&cTest". I believe Dragan (sorry if I got this wrong) already mentioned this, in a message above.
>>>
>>>I think that it doesn't matter if the variable is in scope at the time you insert the expression in the property window, but things can get ugly if the expression can not be resolved at instantiation time.
>>
>>Do not use the property sheet in this manner. It is much clearer in code. In the init of the form is the place to set the property.
>
>Mike, if properties could be in a not-set state unless their value were set in code, I could agree with you. But that it's not the case.
>
>Prefixing an assignment in the properties windows is our way to say to VFP "don't need to be smart, I know what I'm doing and I'm going to assign the value of this property as if if there is no properties window". That is, as if I was writing this in code.

Just because the property sheet allows this, does not mean we should. It is not exactly clear when used.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform