SMath Studio Forum
»
SMath Studio
»
Feature Requests
»
RETURN(expr) operator inside a function
Rank: Advanced Member Groups: Registered
Joined: 22/02/2014(UTC) Posts: 84
Was thanked: 12 time(s) in 11 post(s)
|
As usual, something doesn't work in freshly written function code. The most useful feature for debugging is ability to dump indexes, intermediate results and e.t.c. In Mathcad_11 I always used a command like "return(M) if (1)", where M was a matrix filled with variables I wanted to see. It seems not very difficult to implement "return()" in Smath as well. Of course, there is a workaround by means of using "if" operators, but nested IFs make function code unnecessary complicated and hard to remove when debugging is done. And I actually hate typing to many characters and use multiple "line" operators . Regards, Igor P.S. Another time saving feature for debugging is STOP operator. In Verilog you can use $stop to terminate simulation at desired point. Edited by user 28 February 2014 18:49:17(UTC)
| Reason: Not specified
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 13/01/2012(UTC) Posts: 2,725 Location: Italy Was thanked: 1393 time(s) in 909 post(s)
|
|
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects |
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 22/02/2014(UTC) Posts: 84
Was thanked: 12 time(s) in 11 post(s)
|
You are right, I didn't use trace() so far. I started to use Smath recently mostly because of it symbolic nature. But I'm still keeping some old Mathcad habits. I hope that return() is useful anyway. In many cases it simplifies the code a lot improving readability. Trace() is nice feature, but sometimes it is useful to prematurely terminate or pause function execution. Let say "return(trace(xxx))" or pause(trace(xxx)) is very useful as well. Davide, do you know how to distinguish symbolic/numeric optimization without clicking on "Optimization" tub ? Is there a way to assign different background/color/font to expressions evaluated symbolically ? Regards Edited by user 28 February 2014 19:42:26(UTC)
| Reason: Not specified
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 13/01/2012(UTC) Posts: 2,725 Location: Italy Was thanked: 1393 time(s) in 909 post(s)
|
Actually there's not a fast way to distinguish between symbolic/numeric evaluation, there are several proposal in this section or scattered in the forum... Math formatting actually is available at low-level only (plugins) I don't know if there are magic attributes to set in the xml code... When I have enough time this feature will be added in my TableRegion plugin... BTW the return function is not a bad idea. Edited by user 28 February 2014 21:28:07(UTC)
| Reason: Not specified |
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects |
|
|
|
SMath Studio Forum
»
SMath Studio
»
Feature Requests
»
RETURN(expr) operator inside a function
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.