Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get length of a dynamic array in Delphi? [closed]

Tags:

delphi

Is there a function to determine length of a dynamic array in Delphi ?

like image 476
Bogdan Doicin Avatar asked Dec 06 '22 09:12

Bogdan Doicin


1 Answers

Use Length function to get the length of your array:

var
  ArrayLength: Integer;
begin
  ArrayLength := Length(ArrayOfSomething);
  ...
end;

From the reference for this function (emphasized by me):

In Delphi code, Length returns the number of characters actually used in the string or the number of elements in the array.

like image 177
TLama Avatar answered Dec 18 '22 17:12

TLama