Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Default Property of an object
Message
From
12/08/2001 11:28:56
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00537719
Message ID:
00542757
Views:
16
>Hi!
>
>No. You can define property TextBox, than add object TextBox. Property will return value when Accessing TextBox as object will work with object. Than in the textBox_Assign method you define what to return from TextBox object. But this is with use of the parent container only...

Right - I thought it would be possible to use the rarely used this_access method in the textbox class, and I've made this:
LPARAMETERS cMember
if empty(cMember)
	return this.value
else
	RETURN THIS
endif<pre>

and it would work, if Fox would ever call this_access without a member; if you mention the object without a ".property" part attached to it, Fox simply gives you the object reference. This means the cMember will never be empty in this_access method.

It's actually the thing in VB which I think is, well, if not wrong, then sort of non-OOP. If an object has a default property, then the original 
<pre>set x = Form.Textbox   
set x = Form.Textbox.Text
means you have to jump through some hoops to create an additional reference to form.textbox, since both of the above actually leave you with the .text, not the reference.

I'm not sorry at all for not having default properties in Fox, specially if having them would mean losing the easy way of passing object references.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform