On Mon, 10 Oct 2016 14:07:35 +0200, Vojtěch Čihák
wrote:
> then Break;
>
Isn't leaving for loop with break only case, where loop variable
will keep the value. Otherwise it is undefined.
But it does make the code more confusing.
--
Virgo Pärna
virgo.pa...@mail.ee
On Mon, Oct 10, 2016 at 3:07 PM, Vojtěch Čihák wrote:
> Hi, if you mean this:
> ...
Yes, that is one of them.
The code does not make sense in any case, regardless of "i"'s value.
Index for cActionListEditorUnknownCategory and
cActionListEditorAllCategory differ.
"i" cannot have both at the same t
Hi, if you mean this:
function CategoryIndexOf(Name: String): Integer;
var
i: Integer;
begin
for i:= lstCategory.Items.Count-1 downto 0 do begin
if lstCategory.Items[i] = Name
then Break;
end;
Result := i;
if (i = lstCategory.Items.IndexOf(cActionListEditorUnk
Juha Manninen wrote on Mon, 10 Oct 2016:
I have always avoided using a for-loop index variable after the loop.
I thought its value can be unpredictable in some situations when the
compiler reuses its register or memory etc.
That is correct.
The compiler, FPC 3.0, does not warn about it.
I