Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline tomtit  
#1 Posted : 28 February 2014 18:32:06(UTC)
tomtit


Rank: Advanced Member

Groups: Registered
Joined: 22/02/2014(UTC)
Posts: 81

Was thanked: 11 time(s) in 10 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 Biggrin .
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

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline Davide Carpi  
#2 Posted : 28 February 2014 18:48:27(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,647
Man
Italy
Location: Italy

Was thanked: 1329 time(s) in 875 post(s)
Never tried trace() ?
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
Offline tomtit  
#3 Posted : 28 February 2014 18:56:30(UTC)
tomtit


Rank: Advanced Member

Groups: Registered
Joined: 22/02/2014(UTC)
Posts: 81

Was thanked: 11 time(s) in 10 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

Offline Davide Carpi  
#4 Posted : 28 February 2014 21:25:15(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,647
Man
Italy
Location: Italy

Was thanked: 1329 time(s) in 875 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
Users browsing this topic
Guest
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.