I have an ADOStoredProc on my form. It’s not visual but in code.Normally it’s pretty easy to handle an event if a component is visual.It’s just a matter of double clicking the desired event. But how do I do it with code.I’ve declared a procedure:
procedure SP_SearchAfterScroll(DataSet:TDataSet)
Now how do I assign SP_Search(this is the ADOStoredProc) AfterScroll event handler property to the procedure I wrote above. I’m sure you’re going to answer it. So thanks in advance.
When SP_Search is the TAdoStoredProc and has an OnAfterScroll property, all you need to do is:
I am assuming that you used the correct signature for SP_SearchAfterScroll. That is to say that the OnAfterScroll property has a type looks like:
If the OnAfterScroll property has a type that differs from this, you will need to make sure that your SP_SearchAfterScroll procedure matches the parameters in that type.
Edit
In the comments Mikayil asked
I hadn’t gotten round to answering that and in the mean time Mikey explained it very well, so for (easier) future reference I am including his explanation up here: