|
Swap
Apr 22, 2020 1:51:32 GMT -6
Post by johnno56 on Apr 22, 2020 1:51:32 GMT -6
Whilst looking for sort routines, for a game high score table, I came across a handy routine that simulates the swap(a,b) function.
' ============= ' SWAP function ' ============= Function swap( a, b ) tmp = a a = b b = tmp End Function
Something to add to your toolbox....
|
|
|
Swap
Apr 22, 2020 12:01:36 GMT -6
Post by n00b on Apr 22, 2020 12:01:36 GMT -6
To make this function work in rcbasic you need to add ByRef.
Function swap(ByRef a, ByRef b) tmp = a a = b b = tmp End Function
|
|
|
Swap
Apr 22, 2020 14:43:06 GMT -6
Post by johnno56 on Apr 22, 2020 14:43:06 GMT -6
Ah, Cool... Thanks for that...
|
|