System.IsDynArrayRectangular

From Appmethod Libraries
Jump to: navigation, search

Object Pascal

function IsDynArrayRectangular(const DynArray: Pointer; typeInfo: Pointer): Boolean;

C++

extern DELPHI_PACKAGE bool __fastcall IsDynArrayRectangular(const void * DynArray, void * typeInfo);

Properties

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

Description

Returns whether a dynamic array is rectangular.

IsDynArrayRectangular returns a Boolean value that indicates whether the DynArray dynamic array is rectangular. A dynamic array is rectangular if every dimension contains subdimensions of the same size.

The typeInfo parameter represents the array type information. (See the TypeInfo function.)

Example

type
  T2DDynamArray = array of array of String;

var
  A: T2DDynamArray;
  IsRectangular: Boolean;

begin
  SetLength(A, 8, 9);
  IsRectangular := IsDynArrayRectangular(Pointer(A), TypeInfo(T2DDynamArray)); // True

  SetLength(A, 2);
  SetLength(A[0], 8);
  SetLength(A[1], 9);
  IsRectangular := IsDynArrayRectangular(Pointer(A), TypeInfo(T2DDynamArray)); // False

end.

See Also