Array Class


Array Class

Namespace

System

Creatable

Yes

Description

The Array object implements an ordered list of objects, numbered from 0 to a specified upper bound. Arrays can include multiple dimensions, each of which has its own range. Although the Array class is a distinct .NET class, it is wrapped by Visual Basic as its own array implementation; any standard VB array can take advantage of the Array class features.

The following table lists some of the more useful and interesting members of the Array class. Those marked with an asterisk (*) have separate entries in this chapter.

Member

Description

BinarySearch Method *

Searches for an element in a sorted array dimension

Clear Method

Sets a range of array elements to their default content value

Clone Method

Creates a copy of an array, although reference type elements in the new array refer to the same objects as those in the old array

Copy Method *

Copies elements of one array into another existing array

GetValue Method

Retrieves a single value from an array

IndexOf Method *

Finds the first occurrence of a value in a range of array elements

IsReadOnly Property

Indicates whether the array is read-only or not

LastIndexOf Method *

Finds the last occurrence of a value in a range of array elements

Length Property

Identifies the full number of elements in all dimensions

Rank Property

Identifies the number of dimensions

Reverse Method *

Reverses the order of a range of array elements

SetValue Method

Sets a single value in an array

Sort Method *

Sorts a range of elements in an array


Version Differences

Arrays in VB 6 were an intrinsic part of the language and were not associated with the larger set of functionality available through the System.Array class.




Visual Basic 2005(c) In a Nutshell
Visual Basic 2005 in a Nutshell (In a Nutshell (OReilly))
ISBN: 059610152X
EAN: 2147483647
Year: 2004
Pages: 712

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net