System.DynArrayBounds

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function DynArrayBounds(const DynArray: Pointer; typeInfo: Pointer): TBoundArray;

C++

extern DELPHI_PACKAGE TBoundArray __fastcall DynArrayBounds(const void * DynArray, void * typeInfo);

Properties

Type Visibility Source Unit Parent
function public
System.pas
System.hpp
System System

Description

Returns the bounds of a DynamicArray.

DynArrayBounds returns an array of integers representing the high values of each dimension of a dynamic array.

Example

type
  T2DDynamArray = array of array of String;

var
  A: T2DDynamArray;
  Bound: TBoundArray;
  High: Integer;

begin
  SetLength(A, 3, 4);
  Bound := DynArrayBounds(Pointer(A), TypeInfo(T2DDynamArray));
  for High in Bound do
  begin
    Writeln(IntToStr(High));
  end;
end.

Console output:

2
3

See Also