I have many TTable components in my app and I want all(actually, most) of them to have the same common BeforeDelete event handler (A custom "are you sure" MessageDlg).
I tried to create a procedure:
Procedure CommonBeforeDelete(DataSet : TDataSet);
This has the same prototype as TDataSetNotifyEvent.
I declared that proc in a commonly used unit.
Each time my app starts it runs a loop which opens any TTable it finds, I tried to assign the "BeforeDelete" event to that proc - but it won't compile.
I also tried declaring a variable as TDataSetNotifyEvent and make it point to that proc, but it won't go as well.
How do I do it?
Is there a better way to make a common data-aware delete confirmation?