Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Eventbinding question
Message
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Eventbinding question
Miscellaneous
Thread ID:
00782700
Message ID:
00782700
Views:
54
I'm playing around with event binding inside of VFP 8 and had a quick question about it. BINDEVENT() assumes I have an object reference to an object that will be raising events. What if I don't know (or want to know) the event source? Is their a way to raise/bind to an event that isn't part of an object (eg. for example, call a function instead)? Here's the syntax I'd like to use (but doesn't work):
* Define the event
FUNCTION MyCustomEvent(tuSomeParameter)
ENDFUNC

* Raise the event
lcParameter = "Hello"
RAISEVENT(.NULL., "MyCustomEvent", "Hello")

* Bind a method to the event
BINDEVENT(.NULL., "MyCustomEvent", This, "MyEventHandler")
If there is a way to do this, that'd be great (otherwise I'll stop wasting my time trying to do this <g>). According to the docs, I've got to pass an object reference. I guess I could create a private "Event" object that's in scope for the entire life of the app, and let it handle the events. That just seems, well, weird.
-Paul

RCS Solutions, Inc.
Blog
Twitter
Next
Reply
Map
View

Click here to load this message in the networking platform