SWAP

Previous  Next

 

SWAP variable1, variable2

 


 

Exchanges the values of two of the same type variables.

 

Example:

 

DIM a AS STRING

DIM b AS STRING

 

a = "Kalle Anka"

b = "Nisse Hult"

 

PRINT "Before: ";a; ", "; b,

SWAP a, b

PRINT "After:  ";a; ", "; b,

 

Before: Kalle Anka, Nisse Hult

After:  Nisse Hult, Kalle Anka