<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 20/02/2019 19:31, Franz Müller
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:99718caf-4987-709f-1334-0dc0294c5b0c@focusdata.at">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
It's a nice example why scoped variables would be in fact better,
because the value of i is undefined if the for loop is exited
normally. So even the original code wouln't work as expected, you
cannot rely on i>High(arr) in that case, it depends on the way
the for loop is implemented.
<pre style="background-color: white; border: none; font-family: Lola; font-size: 18px">Using only the variable local to the loop would cause a compiler error, while using only the variable defined in the function body would not even cause a warning but leed to unwanted results.
</pre>
</blockquote>
<br>
That does not need inlined variables.<br>
<br>
The compiler already has a warning about uninitialized vars. If not
detected after a for loop, this should be improved (rather than
adding some other workaround).<br>
<br>
And there is a command line switch to tread warnings as errors. So
that problem is perfectly solve-able.<br>
<br>
</body>
</html>