954,568 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?

Swap

0
By Comatose on Aug 6th, 2006 11:26 pm

Swaps Two Elements Of An Array (So that say, indice1's value would become indice2's value, and vice versa). Simple Code Piece Really...

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

wow...this looks preti simple

a.j.
Newbie Poster
10 posts since May 2009
Reputation Points: 10
Solved Threads: 3
 

hey
right , it looks too easy but which library should we use.

AbulHassan
Newbie Poster
1 post since Mar 2010
Reputation Points: 10
Solved Threads: 0
 

Abul, that code does not require a reference...

vb5prgrmr
Posting Virtuoso
1,912 posts since Mar 2009
Reputation Points: 156
Solved Threads: 296
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You