Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BINDEVENT() and parameters
Message
From
04/05/2003 20:16:17
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00784704
Message ID:
00784746
Views:
12
>>>Hi Jim,
>>>
>>>I guess you missed following part of the BINDEVENT() help: "The delegate method must have the same parameters as the event specified in cEvent". If your events have 3 parameters and in the same order as in CustomMethodOfClass method, than you can bind them.
>>
>>Actually no, I didn't miss it, I just didn't understand it.
>>
>>Some of these (single) method calls are in UpClick and DownClick events, which themselves have no paramaters.
>>Others are in MouseWheel or MouseUp, which have different parameters.
>>
>>So I was looking to learn how I could use BINDEVENT() in the case cited, and it appears that I can't DIRECTLY.
>>
>>I simply wanted to have one place to go create/MAINTAIN the actual method calls rather than having to visit EVERY pertinent object's relevant events where they are needed as it is easy to overlook one (or more) doing it the individual way.
>
>You still can do it by creating intermediate method with enough parameters to bind to all the events you need. In that method you can use AEVENTS( ArrayName, 0) to determine the caller and process parameters accordingly, if necessary, and than call CustomMethodOfClass method.

Yes. I'm toying with the idea of replacing the method calls in each event with a standard one that is to an empty one that has the parameter count needed and then using BINDEVENT() for that empty one as 'source' to invoke the real one for each event's method.
That's actually more code though and I'm still not sure that it does anything for later maintenance.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform