DelphiBasics
  Home  |  Delphi .net Home  |  System NameSpace
 .NET Framework
 Namespace References

 System
 
  Array  Class 
  Boolean  Structure 
  Buffer  Class 
  Byte  Structure 
  Char  Structure 
  Console  Class 
  Convert  Class 
  DateTime  Structure 
  DayOfWeek  Enumeration 
  Decimal  Structure 
  Double  Structure 
  Enum  Class 
  Environment  Class 
  Exception  Class 
  ICloneable  Interface 
  Int16  Structure 
  Int32  Structure 
  Int64  Structure 
  Math  Class 
  Object  Class 
  OperatingSystem  Class 
  Random  Class 
  SByte  Structure 
  Single  Structure 
  String  Class 
  TimeSpan  Structure 
  UInt16  Structure 
  UInt32  Structure 
  UInt64  Structure 
  Version  Class 
 System.Collections
 System.Globalization
 System.IO

 Articles and Tutorials

 Overview of .NET
 Delphi and .NET
 Winform Applications
 ASP .Net Applications
 php Web Services
 Framework Collections
 Framework String Handling
 Framework Files and Folders


 
 
  System.Array Class
 
 Description
The Array class provides basic array support. This is in addition to the pre-existing Delphi primitive array type support. For more powerful array handling, see System.Collections.ArrayList, which allows elements to be inserted and deleted.
 
An array is a set of elements. A single dimension array is like a list. A 2 dimensional array is like a list of lists. And so on.
 
Each element in an array can be accessed by its relative position, called Index.
 
Do not get confused with the native Delphi Array type. The latter is retained, allowing for primitive static (size fixed in the declaration) and dynamic arrays. On this site, .Net arrays will be identified as System.Array types.
 
Note that one of the CreateInstance methods uses a native array primitives to hold the sizes of each dimension of the array.
 
Unlike native Delphi arrays, multidimensional .Net arrays are self contained - a native multidimensional array is literally an array of arrays - each base array element contains an independant array that is simply referenced by that element.
 
There is no Create constructor for Array. Instead, you must use the CreateInstance method at run time to create the array. This route was chosen so as to support dynamic array sizes. (There is no SetLength method for setting the array size after creation, and the Length property is read-only).
 Methods
BinarySearch  Searches a one-dimensional sorted Array for a specific element
Clear  Sets a range of elements in an Array to zero, false, or null as appropriate
Clone  Creates a shallow clone (copy) of the current array to a new array
Copy  Copies a sequence of elements from one array to another
CopyTo  Copies the current single dimension array values into another array
CreateInstance  Creates a single or multi dimensional array
GetEnumerator  Gets an enumerator to allow reading the elements of the current array
GetLength  Gets the length of a dimension of the current array
GetLowerBound  Gets the lower bound of a specified array dimension
GetUpperBound  Gets the upper bound of a specified array dimension
GetValue  Gets the value from an element of the current array
IndexOf  Tries to find the first occurence of an object in a single dimensional arra
LastIndexOf  Tries to find the last occurence of an object in a single dimensional array
Reverse  Reverses the sequence of elements in a single dimension array
SetValue  Sets the value in an element of the current array
Sort  Sorts an array or part of an array into value sequence

 Properties
IsFixedSize  Boolean  Gets a value indicating whether the Array has a fixed size.
IsReadOnly  Boolean  Gets a value indicating whether the Array is read-only.
IsSynchronized  Boolean  Gets a value indicating whether access to the Array is synchronized (thread-safe).
Length  Integer  Gets a 32-bit integer that represents the total number of elements in all the dimensions of the Array.
LongLength  Int64  Gets a 64-bit integer that represents the total number of elements in all the dimensions of the Array. (Not Compact Framework compatible)
Rank  Integer  Gets the rank (number of dimensions) of the Array.
SyncRoot  Object  Gets an object that can be used to synchronize access to the Array.

 Delphi Basics links
 
System.Collections.ArrayList
System.Array

 Microsoft MSDN links
 
System
System.array
 
Delphi Programming © Neil Moffatt . All rights reserved.  |  Home Page