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

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! 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

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.

Announcements

Top Tags