Does SB have a SWAP function?
Posted: Sun Nov 05, 2023 4:48 am
Or how can I implement a SWAP(x,y) function in SB?
This doesn't work for me as I thought it might...
a=1 ! b=2
PRINT a,b
swap(a,b)
PRINT a,b
END
DEF swap(x,y)
temp=x
x=y
y=temp
ENDDEF
Many thanks!
Mark
This doesn't work for me as I thought it might...
a=1 ! b=2
PRINT a,b
swap(a,b)
PRINT a,b
END
DEF swap(x,y)
temp=x
x=y
y=temp
ENDDEF
Many thanks!
Mark