1 страниц (4 вхождений)
RETURN(expr) operator inside a function - Сообщения
#1 Опубликовано: 28.02.2014 11:32:06
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 :d .
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.
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 :d .
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.
#2 Опубликовано: 28.02.2014 11:48:27
Never tried trace() ?
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#3 Опубликовано: 28.02.2014 11:56:30
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
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
#4 Опубликовано: 28.02.2014 14:25:15
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.
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.
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
1 страниц (4 вхождений)
-
Новые сообщения
-
Нет новых сообщений