0
I am downloading several files (one after the other) by one loop, but as soon as the first one goes down, it gives crash. Follows 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;
On the line if pexit = true then break;
when I put the mouse on top, gives the message:
Break = Illegal expression in Evaluator.
How can I avoid that mistake?
Edit: I found that the error is within the Download function. That 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 had already declared:
downloadedf : array of string;
And over the line of error:
SetLength(downloadedf, Length(downloadedf) +1);
There’s something wrong?
What is the value of the variable
pexit
? If it really is boolean type do not check this way.if pexit = true
is the same thing asif pexit
. Now,if
expecting atrue
or afalse
, always. Ifpexit
is worth one of these values, just use the variable, do not need to ask if it is worth it, use the existing value. But the error may be precisely because the variable may be worth something else.– Maniero
@bigown, Any time "pexit" assumes another value that is not true or false, and test: if pexit then break end; and continues the problem.
– Gabriel Sales
Unless there’s something else that doesn’t appear in the code, then it’s impossible to give that error where you’re pointing.
– Maniero
I found the error line is inside the Download function, I will edit the post.
– Gabriel Sales