title: Can array types have methods?
body: <p>I have defined a dynamic array type as follows:</p>
  
  <pre><code>TMyIntegerArray = array of integer:
  </code></pre>
  
  <p>I would like to use an <code>IndexOf</code> function as I would do if it were a <code>TObject</code>'s descendant:</p>
  
  <pre><code>var
    MyArray : TMyIntegerArray;
    i : integer:
  begin
    //...
    i := MyArray.IndexOf(10);
    //...
  end;
  </code></pre>
  
  <p>At the moment, the only solution I've found is to write a function who accepts the array and the target value as parameters:</p>
  
  <pre><code>function IndexOf(AArray : TMyIntegerArray; ATargetValue : integer; AOffset : integer = 0);
  begin
    Result := AOffset;
    while(Result &lt; Length(AArray)) do
    begin
      if(AArray[Result] = ATargetValue)
      then Exit;
      Result := Result + 1;
    end;
    Result := -1;
  end;
  </code></pre>
  
  <p>Can <code>TMyIntegerArray</code> type have a function like <code>IndexOf</code>?</p>
  
  <p><strong>Further Informations:</strong></p>
  
  <p>Currently, I'm using Delphi2007 but I'm also interested in knowing if there's any way to add methods to array types in newer Delphi's versions.</p>