Learning Question
If I use a line of code like
Win_1.Button1.enabled:= .F. I may get an error that I can
solve with Setproperty("Win_1","Button1","enabled",.F.)
Please explain the rules for when you must use set/getproperty functions
Thanks
When must I use set/get property?
Moderator: Rathinagiri
Re: When must I use set/get property?
When your form Win_1 is known earlier or if you declare Win_1, you can use first statement. If you form Win_1 is loaded/declared/defined in other module (.prg) only SetProperty will work.
- serge_girard
- Posts: 3167
- Joined: Sun Nov 25, 2012 2:44 pm
- DBs Used: 1 MySQL - MariaDB
2 DBF - Location: Belgium
- Contact:
Re: When must I use set/get property?
This reminds me to the following important difference:
Code: Select all
some_form := 'FORM_1'
some_field := 'FIELD_1'
nVAR := GetProperty(some_form, some_field, 'Value')
// or
SetProperty(some_form, some_field, 'Value', nVAR)
/* is impossible with &some_form.&some_field.Value := x */
There's nothing you can do that can't be done...