Skip to main content
24-Ruby IV
April 17, 2016
Solved

swap in Mathcad

Can we have in Mathcad same statement?

a:=1

b:=2

swap(a, b)

a=2

b=1

24-Ruby IV
April 18, 2016

4 replies

23-Emerald V
April 17, 2016

sort of:

Success!
Luc

Translate
ValeryOchkov24-Ruby IVAuthorAnswer
24-Ruby IV
April 18, 2016

Translate
Werner_E
25-Diamond I
April 17, 2016

This would be inconsistent as it would be the first and only Mathcad command which directly operates on and changes worksheet variables without using an assignment. After all, Mathcads progranmming does not support passing function arguments by reference, just call by value.

And Lucs swap-routine is easy enough to write anyway.

But maybe there is a way to do it the way you want using scipted components. Just give it a try and let us know.

Translate
24-Ruby IV
May 1, 2016

Translate