Sorts a pair of one-dimensional Array objects- one containing the keys and the other containing the corresponding items- based on the keys in the first Array, using the IComparable interface implemented by each key.
[Visual Basic] Overloads Public Shared Sub Sort( _ ByVal keys As Array, _ ByVal items As Array _ ) [C#] public static void Sort( Array keys, Array items ); [C++] public: static void Sort( Array* keys, Array* items ); [JScript] public static function Sort( keys : Array, items : Array );
-or-
a null reference (in Visual Basic Nothing) to sort only the keys Array.
None.
Exception Type | Condition |
---|---|
ArgumentNullException | keys is a null reference (Nothing).
-or- items is a null reference (Nothing). |
RankException | keys is multidimensional.
-or- items is multidimensional. |
ArgumentException | items is not a null reference (Nothing), and the lower bound of keys does not match the lower bound of items. |
Each key in the keys Array has a corresponding item in the items Array. When a key is repositioned during the sorting, the corresponding item in the items Array is similarly repositioned. Therefore, the items Array is sorted according to the arrangement of the corresponding keys in the keys Array.
Each key in the keys Array must implement the IComparable interface to be capable of comparisons with every other key.
Array Class | Array Members | System Namespace | Array.Sort Overload List | IComparable | BinarySearch