mlhaufe

Variable Swapping

Jun 20th, 2011
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sub Swap(ByRef a, ByRef b)
  2.     Dim t : t = a
  3.     a = b
  4.     b = t
  5. End Sub
  6.  
  7. Dim foo : foo = "a"
  8. Dim bar : bar = "b"
  9.  
  10. MsgBox foo & "," & bar
  11.  
  12. Swap foo, bar
  13.  
  14. MsgBox foo & "," & bar
Advertisement
Add Comment
Please, Sign In to add comment