August 2001
Intermediate to advanced
656 pages
18h 5m
English
Array.Reverse Method
System.Array
Array.Reverse(array[, startindex, endindex])array
Use: Required
Data Type: Any array
The array to be reversed
startIndex
Use: Optional
Data Type: Integer
The index at which to start the reversal process
endIndex
Use: Optional
Data Type: Integer
The index at which to end the reversal process
None
Reverses a portion of or all of the elements of an array.
Dim a( ) As Integer = {1, 2, 3, 4, 5}
Dim i As Integer
array.Reverse(a, 1, 3)
For i = 0 To 4
debug.Write(a(i))
NextThis code prints the sequence 14325, which is the original array 12345 with the middle section from index 1 to index 3 reversed.
Read now
Unlock full access