Swaps Two Elements Of An Array (So that say, indice1's value would become indice2's value, and vice versa). Simple Code Piece Really...
Swap
Public Sub Swap(ByRef AName() As String, Indice1 As Integer, Indice2 As Integer)
Dim tmp As String
' /* Set The Temporary Variable To The Value Of The First Passed Indice */
tmp = AName(Indice1)
' /* Replace The Value Of The First Passed Indice, With The Value Of The Second */
AName(Indice1) = AName(Indice2)
' /* Set The Value Of The Second Passed Indice, To The Value Of The First Passed Indice */
AName(Indice2) = tmp
End Sub
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.