Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>When SP_Search is the TAdoStoredProc and has an OnAfterScroll property, all you need to do is:</p> <pre><code>SP_Search.OnAfterScroll := SP_SearchAfterScroll; </code></pre> <p>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:</p> <pre><code>TScrollEvent = procedure(DataSet: TDataSet) of object; </code></pre> <p>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.</p> <p><strong>Edit</strong></p> <p>In the comments Mikayil asked </p> <blockquote> <p><code>SP_Search.AfterScroll := SP_SearchAfterScroll(SPSearch)'</code> the compiler complains saying incompatible types TNotifyEvent and procedure. But when I write <code>SP_Search.AfterScroll := SP_SearchAfterScroll</code> it works. What's the difference?</p> </blockquote> <p>I hadn't gotten round to answering that and in the mean time <strong>Mikey</strong> explained it very well, so for (easier) future reference I am including his explanation up here:</p> <blockquote> <p><code>SP_Search.AfterScroll :=</code> that code assigns a function to handle the event when it fires - you are not making a call to SP_SearchAfterScroll at 'assign time' just assigning a value to a variable, so you don't pass parameter. Parameter is needed when call is made - when event fires then caller will assign parameter with the right value. When you pass the parameter,compiler assumes you are calling the function, not assigning it, so you get incompatible types error. When you simply assign the function without the parameter, compiler understands you're assigning, not calling the function.</p> </blockquote>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload