【新人】delphi数组赋值如何报错啊

【新人求助】delphi数组赋值怎么报错啊??
function GetStringBetween(const FullStr, StrLeft, StrRight: String): string;
var
sPos,ePos,i :integer;
str :WideString;
sl :TStringList;
data : array of String;
begin
sl := TStringList.Create;
i := -1 ;
try
str := FullStr;
repeat

sPos := Pos(StrLeft,str); 
if sPos > 0 then 
begin
//for i:=0 to 100 do data[i]:='0';
ePos := Pos(StrRight,str); 
if ePos > 0 then 
sl.Add(Copy(str,sPos ,ePos - sPos)) 
data[i]:= Copy(str,sPos ,ePos - sPos)             ←这句报错:Missing operator or semicolon
else
begin  
sl.Add(str);
sPos := 0;
end;
str := Copy(str,ePos + 1,Length(str) - ePos);
end;
i :=i+1  ;
until sPos = 0;
result:=sl.Text;
//  Writeln(sl.count -1);
//  Writeln(i -1);
finally
FreeAndNil(sl);
end;
end;



写了个查找 左右关键字中间的字符串 的一个函数,可是怎么给数组赋值赋不了呢?
------解决思路----------------------
function GetStringBetween(const FullStr, StrLeft, StrRight: string): string;
var
  sPos, ePos, i: integer;
  str: WideString;
  sl: TStringList;
  data: array of string;
begin
  sl := TStringList.Create;
  i := -1;
  try
    str := FullStr;
    repeat

      sPos := Pos(StrLeft, str);
      if sPos > 0 then
      begin
//for i:=0 to 100 do data[i]:='0';
        ePos := Pos(StrRight, str);
        if ePos > 0 then
        begin  //add begin
          sl.Add(Copy(str, sPos, ePos - sPos));  //add semicolon
          data[i] := Copy(str, sPos, ePos - sPos);   //add semicolon   //←这句报错:Missing operator or semicolon
        end  //add end
        else
        begin
          sl.Add(str);
          sPos := 0;
        end;
        str := Copy(str, ePos + 1, Length(str) - ePos);
      end;
      i := i + 1;
    until sPos = 0;
    result := sl.Text;
//  Writeln(sl.count -1);
//  Writeln(i -1);
  finally
    FreeAndNil(sl);
  end;
end;

只修语法错误,逻辑错误就没法看了。