Well, a swap function typically involves 3 variables; the two you are swapping and one used as a temp store. To perform a swap in code you would(assuming you had three variables named x, y, z and you wanted to swap x and y):
Code:
     z = x
     x = y
     y = z
And that would swap the values of variables x and y. Now just attempt to apply that to a macro and you'll be there.