Search found 1 match

by marklpenni
Sun Nov 05, 2023 4:48 am
Forum: Other topics
Topic: Does SB have a SWAP function?
Replies: 1
Views: 2122
Flag: United States of America

Does SB have a SWAP function?

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