cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can change your system assigned username to something more personal in your community settings. X

swap in Mathcad

ValeryOchkov
24-Ruby IV

swap in Mathcad

Can we have in Mathcad same statement?

a:=1

b:=2

swap(a, b)

a=2

b=1

1 ACCEPTED SOLUTION

Accepted Solutions

4 REPLIES 4
LucMeekes
23-Emerald III
(To:ValeryOchkov)

sort of:

Success!
Luc

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.

Top Tags