Swap

This algorithm exchanges the value of two variables.



									Public Shared Sub Swap(ByRef a As Integer, ByRef b As Integer)
	a = a Xor b
	b = b Xor a
	a = a Xor b
End Sub
								


Example

									Dim a = 1025
Dim b = -5579
Swap(a, b)
								


Output

									a: -5579
b: 1025