Re: Работа с массивами в Delphi
От: mrhru Россия  
Дата: 10.02.03 09:37
Оценка: 10 (1)
Здравствуйте, <Аноним>, Вы писали:

А>Пример:

А>
А>procedure GG(Arrra : array of integer);
А>begin
А>  //что получим, если написать
А>  ShowMessage(IntToStr(Arrra[1])); 
А>end;

А>procedure BB();
А>var blabla : array [1..20] of integer;
А>begin
А>  blabla[1]:=12;
А>  GG(blabla);
А>end;
А>

А>Почему в сообщении не "12"? Вообще почему идет чтение не 1-го элемента?

array of integer, как параметр функции — начинается всегда с 0.

"Within the body of a routine, open array parameters are governed by the following rules.

They are always zero-based. The first element is 0, the second element is 1, and so forth. The standard Low and High functions return 0 and Length — 1, respectively. The SizeOf function returns the size of the actual array passed to the routine."
Евгений
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.