title: type identifier expected fpc compiler error
body: <p>I have the following function which is supposed to split a string into a string array (I'm using Geany IDE and fpc compiler):</p>
  
  <pre><code>   function Split(const str: string; const separator: string): array of string;
  var
  i, n: integer;
  strline, strfield: string;
    begin
   n:= Occurs(str, separator);
   SetLength(Result, n + 1);
   i := 0;
   strline:= str;
   repeat
  if Pos(separator, strline) &gt; 0 then
  begin
    strfield:= Copy(strline, 1, Pos(separator, strline) - 1);
    strline:= Copy(strline, Pos(separator, strline) + 1, 
  Length(strline) - pos(separator,strline));
  end
  else
  begin
    strfield:= strline;
    strline:= '';
  end;
  Result[i]:= strfield;
  Inc(i);
  until strline= '';
  if Result[High(Result)] = '' then SetLength(Result, Length(Result) -1);
  end;
  </code></pre>
  
  <p>The compiler reports an error: </p>
  
  <pre><code> calc.pas(24,61) Error: Type identifier expected
   calc.pas(24,61) Fatal: Syntax error, ";" expected but "ARRAY" found
  </code></pre>
  
  <p>As far as I can see the syntax is correct, what is the problem here?</p>