title: How to Pass Functions as Parameters in Procedures in Delphi?
body: <p>Is it possible to pass an object function as a parameter in a procedure rather than passing the whole object?</p>
  
  <p>I have a record definition with a function defined as a public class parameter such as:</p>
  
  <pre><code>    TMyRecord = record
        public
          class function New(const a, b: Integer): TMyRecord; static;
          function GiveMeAValue(inputValue: integer): Single;
        public
          a, b: Integer;
        end;
  </code></pre>
  
  <p>The function could be something like:</p>
  
  <pre><code>    function TMyRecord.GiveMeAValue(inputValue: Integer): Single;
      begin
        RESULT := inputValue/(self.a + self.b);
      end;
  </code></pre>
  
  <p>I then wish to define a procedure that calls on the class function <code>GiveMeAValue</code> but I don't want to pass it the whole record. Can I do something like this, for example:</p>
  
  <pre><code>    Procedure DoSomething(var1: Single; var2, var3: Integer, ?TMyRecord.GiveMeAValue?);
      begin
        var1 = ?TMyRecord.GiveMeAValue?(var2 + var3);
        //Do Some Other Stuff
      end;
  </code></pre>
  
  <p>If so then how would I correctly pass the function as a procedure parameter?</p>