I'm downloading multiple files (one after the other) for a loop , but as soon as I download the first one, it crashes. Here is the loop :
for x := StrToInt(version)+1 to StrToInt(version2) do
begin
url := baseurl+'/'+IntToStr(x)+'.7z';
BaixarArquivo(IdHTTP1, url, x);
if pexit = true then break;
end;
At line if pexit = true then break;
when I put the mouse on it, it gives the message:
Break = Expression illegal in evaluator.
How can I avoid this error?
Edit: I discovered that the error is inside the DownloadFile function. This line:
downloadedf[high(downloadedf)+1] := IntToStr(Name) + ExtractFileExt(Url);
Where
IntToStr(Name) tem o valor de '1'. (String)
ExtractFileExt(Url) tem o valor de '.7z'. (String)
And I have already stated:
downloadedf : array of string;
And above the error line:
SetLength(downloadedf, Length(downloadedf) +1);
Is there something wrong?