Hi all,
I don't use Delphi often so this is probably a stupid question again, but why does Delphi (7) re-index arrays when they're passed to a function, as a simplified example...
program example;
{$APPTYPE CONSOLE}
uses
SysUtils;
var
numbers: array[1..5] of Integer = (10, 20, 30, 40, 50);
procedure example(var nums: array of Integer);
begin
WriteLn(nums[5]); //Undefined. 50 -> nums[4]
end;
begin
Writeln(numbers[5]);
example(numbers);
Readln;
end.
Why does it do this? Thanks in advance for any answers.