Hi, If I pass a TStringList to a function:
function TSLFunctn(myTSL: TSltringList):integer; var i: integer; begin Result:=0; for i:=0 to myTSL.Count-1 do //<-----------fails here begin Result+=strtoint(myTSL.Strings[i]); end; end; The function fails when I try to assign quantify myTSL.Count. However, this works: function TSLFunctn(myTSL: TSltringList):integer; var i: integer; internalTSL: TStringList; begin internalTSL:= TStringList.Create; internalTSL:=myTSL; Result:=0; for i:=0 to internalTSL.Count-1 do //<-----------works begin Result+=strtoint(internalTSL.Strings[i]); end; internalTSL.Free; end; Is this a bug? Or is that the way it's supposed to behave? _______________________________________________ Lazarus mailing list [email protected] http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
