Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Clarifications please - BINDEVENT() and RAISEEVENT()
Message
From
16/04/2003 09:57:10
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro Product Documentation
Title:
Clarifications please - BINDEVENT() and RAISEEVENT()
Miscellaneous
Thread ID:
00778310
Message ID:
00778310
Views:
135
This, of course, is applicable to VFP8.

The new BINDEVENT() function has a nFlags parameter that defaults to 0, that value specifying "Call delegate code before event code.".
Now a nFlags value of 2 is available and in this case it is used to specify "Do not trigger event (call delegate code) when a simple method call occurs.".

Now the RAISEEVENT() "Remarks" starts with the following:
Visual FoxPro does not automatically raise events for custom methods that are bound to objects using BINDEVENT( ) if the methods are called directly. For example, the following code does not raise an event:
oForm.GetMyData(cData)
Instead, to raise an event for a custom method, you need to make the following call:
RAISEEVENT( oForm, "GetMyData", cData )
You can also change this behavior by using BINDEVENT( ) with nFlags set to 2 or 3.

This looks contradictory to me in that the default of 0 in BINDEVENTS() should automatically call the custom method, should it not?

In addition, the example under RAISEEVENTS() is as follows:Activating a form or using Form1.Show triggers the Activate event for the form. However, calling the Activate event directly using a call such as Form1.Activate does not trigger the Activate event. The following example shows how you can use RAISEEVENT( ) to trigger the Activate event:
RAISEEVENT( Form1, "Activate" )
I cannot understand what this is trying to tell me. It strongly suggests that something additional happens when Activate is called using RAISEEVENT().
But what is it that happens extra???

I tried a simple example with a button's Click event to see if it might be saying that the event actually is made to happen, but there was no visible action when that Button.Click() was executed using RAISEEVENT().
Next
Reply
Map
View

Click here to load this message in the networking platform