Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Eventbinding question
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00782700
Message ID:
00782817
Views:
18
So, I am sitting infront of ten telephones, and you want me to answer one of them when it rings, you just don't want to tell me which one.

No, you can't do what you are doing. How can you bind to the event of an object if you don't specify the object?

Perhaps if you give us your use case we can help with an alternative method?

>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform