Page 1 of 1

Swapping two variables

Posted: Fri Dec 31, 2010 9:28 am
by pecaN
Hi,maybe it's a bit stupid one,but what about including a command for swapping two variables to Hollywood? Amos had the Swap(x,y) which did it well while in Hollywood for swapping x and y you have to use another variable eg. :
x = help
x = y
y = help

Sometimes the swap command would be very useful,I found it out while programming BoingPairs...

Re: Swapping two variables

Posted: Fri Dec 31, 2010 11:51 am
by airsoftsoftwair
Oh, well, here it is:

Function Swap(a, b) Return(b, a) EndFunction

Happy new year :)

Re: Swapping two variables

Posted: Sun Jan 02, 2011 11:48 am
by Bugala
Ha, never thought it could be that easy.