An event is a message that is broadcasted to all objects that respond to this event. For example, when a user press on a command button, a Click event is broadcasted and the command button that is linked to this event will execute it's Click method.
In VB (and others language, except VFP) you can create your own event and raise it from within your application. Let's say that you need to keep the user informed on the progress of a process that lies in the business layer in a n-tiers environment. In VFP, since it can't raise events, you will need to pass the name of the method to call from the interface layer to the business layer so that the progress bar can be updated in the loop. This will increase the coupling between the classes and is not desirable. In VB, you could create a Iteration event that will be raised at the end of a loop. You could then create a method to execute when a Iteraction event is fired in the interface layer to update the progress bar. This is a much cleaner approach than the previous one.
Note that even if VFP can't raise events, it can respond to an event with the new VFPCOM available on MS site.
HTH
>Hello, what do you mean by create and raise events?
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only