System.DynArrayIndex

De RAD Studio API Documentation
Révision datée du 18 octobre 2011 à 19:47 par PyBot (discussion | contributions) (Scoping Libraries)
(diff) ← Version précédente | Voir la version actuelle (diff) | Version suivante → (diff)
Aller à : navigation, rechercher

Delphi

function DynArrayIndex(P: Pointer; const Indices: array of NativeInt; TypInfo: Pointer): Pointer; overload;
function DynArrayIndex(P: Pointer; const Indices: array of Integer; TypInfo: Pointer): Pointer; overload;

C++

extern DELPHI_PACKAGE void * __fastcall DynArrayIndex(void * P, int const *Indices, const int Indices_High, void * TypInfo)/* overload */;

Propriétés

Type Visibilité  Source Unité  Parent
function public
System.pas
System.hpp
System System

Description

Renvoie un pointeur sur un élément de tableau dynamique spécifique.

DynArrayIndex renvoie un pointeur sur un élément spécifié par un index d'un tableau dynamique.

Exemple

 
 type
   T2DDynamArray = array of array of Integer;
 
 var
   A: T2DDynamArray;
   P: Pointer;
 
 begin
   SetLength(A, 3, 4);
   A[1][2] := 100;
   P := DynArrayIndex(Pointer(A), [1, 2], TypeInfo(T2DDynamArray));
   Writeln(IntToStr(PInteger(P)^)); // displays 100
 end.