martin2k

Google
 
Web www.martin2k.co.uk

Swapping Variables


Home Read and add posts to the Visual Basic 6.0 Forums Download some of my programs and OCXs Read the Tips here The old style forum is still available here Contact

Back


From: Belinda Penick E-mail: penickb@cstone.net 1

Date: Tuesday, November 6, 2001 at 04:06:06

Subject: Swapping Variables

Comments:

Do you have any information on this or or samples to do of this, swapping variable?

From: Martin Allen E-mail: <No e-mail> 2

Date: Saturday, November 10, 2001 at 19:51:45

Subject: RE: Swapping Variables

Comments:

What is it exactly that you want to do?  Do you mean getting the value of two variables and swapping them?  This can be done by declaring a third variable and using it as a temporary storage space:

Dim var1 As String, var2 As String, tmp As String

var1 = "Hello"
var2 = "World"
tmp = var1
var1 = var2
var2 = tmp 'the variables 'var1' and 'var2' have been swapped around


This forum is no longer taking new messages or replies since 01 November 2002.  The above material is for reference purposes only.

The new Visual Basic 6.0 forum can be found here.


Martin Allen 1999 - 2003.  Last updated Monday 07 April 2003 07:21:42 PM +0100.