Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP 8 Empty Class
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00793345
Message ID:
00793631
Views:
33
>Thanks Ken
>
>So if I understand this then, the only benefit from using the Empty
>class with SCATTER is the ability to add properties. There is no way
>to add methods?

THis is kind of hokey, but you can bind an event to fire a method by changing a property in the empty object. Paste the following code in a PRG and run it:
LOCAL o, x
o = NEWOBJECT('Empty')
ADDPROPERTY(o, 'FireInit')
x = NEWOBJECT('EmptyMethods')
BINDEVENT(o, 'FireInit', x, 'FireInit')
CLEAR
o.FireInit = .t.

DEFINE CLASS EmptyMethods AS Custom

	PROCEDURE FireInit
		WAIT WINDOW NOWAIT 'FireInit fired'
	ENDPROC
	PROCEDURE Release
		RELEASE THIS
	ENDPROC

ENDDEFINE
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform