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 andrbig77  
#1 Posted : 10 September 2021 15:24:11(UTC)
andrbig77


Rank: Advanced Member

Groups: Registered
Joined: 07/12/2018(UTC)
Posts: 44
Man
Germany

Was thanked: 1 time(s) in 1 post(s)
Dear Smath-experts,

How can I evaluate the variables in the loop in SMATH?
I want to see how the variables are changing in the loop like in python.
Is what debug is for, but how does it work?

How_works_debuging.png

Best regards,
Andrey

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

Offline Davide Carpi  
#2 Posted : 10 September 2021 15:40:07(UTC)
Davide Carpi


Rank: Advanced Member

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

Was thanked: 1331 time(s) in 876 post(s)
You can either use the function trace() to show some specific variables (data will be shown in the "output" window on the fly without stopping evaluations) or use the debugger. This is more in "Visual Studio IDE style" and shows you the whole context in a specific point (the breakpoint); this means that the execution is paused when those points are evaluated. To add/remove a breakpoint you can use the context menu (mouse right-click)
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
Offline Jean Giraud  
#3 Posted : 10 September 2021 19:50:44(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: andrbig77 Go to Quoted Post
I want to see how the variables are changing in the loop

You can see it outside the loop, same more vivid.
Cheers ... Jean.

0Anim Landing.sm (57kb) downloaded 13 time(s).



Offline oscampo  
#4 Posted : 10 September 2021 23:28:15(UTC)
oscampo


Rank: Advanced Member

Groups: Registered
Joined: 10/12/2009(UTC)
Posts: 248
Man
Colombia
Location: Cali, Colombia

Was thanked: 87 time(s) in 66 post(s)
Originally Posted by: andrbig77 Go to Quoted Post
Dear Smath-experts,

How can I evaluate the variables in the loop in SMATH?
I want to see how the variables are changing in the loop like in python.
Is what debug is for, but how does it work?

...

Best regards,
Andrey


Hi Andrey, you can use trace() for check how variables are changing in the loop:

trace.png

Regards,

Oscar
Offline Jean Giraud  
#5 Posted : 11 September 2021 03:18:10(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
... for convenience make it algo style collapsed in utilities.
Thus, you will have it from in-situ command line.
Cheers ... Jean.

Utilities Discrete CUMULATIVE algo.sm (5kb) downloaded 4 time(s).
Offline Jean Giraud  
#6 Posted : 11 September 2021 03:34:41(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
... explore/practice

Utilities Discrete CUMULATIVE algo.sm (6kb) downloaded 6 time(s).
Offline Jean Giraud  
#7 Posted : 11 September 2021 15:58:36(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Thanks Oscar for trace.
I couldn't make it produce SS 6179.
Was good idea to refactor my old vintage.
Cheers ... Jean.

Utilities Discrete CUMULATIVE algo.sm (15kb) downloaded 2 time(s).
Offline overlord  
#8 Posted : 11 September 2021 16:37:47(UTC)
overlord


Rank: Advanced Member

Groups: Registered
Joined: 23/07/2013(UTC)
Posts: 1,128
Turkey

Was thanked: 509 time(s) in 339 post(s)
trace() or breakpoints are usually de-facto way to go.
Alternatively you can store variables to a matrix.

Regards

2021-09-11_16-39.png

Edited by user 11 September 2021 16:39:18(UTC)  | Reason: Not specified

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.