How can I evaluate the variables in the loop

How can I evaluate the variables in the loop - Poruke

#1 Objavljeno: 10. 9. 2021. 09:24:11
Andrey

Andrey

1 svidjanja u 44 postova.

Grupa: User

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
#2 Objavljeno: 10. 9. 2021. 09:40:07
Davide Carpi

Davide Carpi

1.444 svidjanja u 2.936 postova.

Grupa: Moderator

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 please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#3 Objavljeno: 10. 9. 2021. 13:50:44
Jean Giraud

Jean Giraud

983 svidjanja u 6.866 postova.

Grupa: User

Wrote

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 (56,24 KiB) preuzeto 1246 put(ova).



#4 Objavljeno: 10. 9. 2021. 17:28:15
Oscar Campo

Oscar Campo

135 svidjanja u 309 postova.

Grupa: Moderator

Wrote

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
#5 Objavljeno: 10. 9. 2021. 21:18:10
Jean Giraud

Jean Giraud

983 svidjanja u 6.866 postova.

Grupa: User

... 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 (4,16 KiB) preuzeto 1254 put(ova).
#6 Objavljeno: 10. 9. 2021. 21:34:41
Jean Giraud

Jean Giraud

983 svidjanja u 6.866 postova.

Grupa: User

... explore/practice

Utilities Discrete CUMULATIVE algo.sm (5,4 KiB) preuzeto 1239 put(ova).
#7 Objavljeno: 11. 9. 2021. 09:58:36
Jean Giraud

Jean Giraud

983 svidjanja u 6.866 postova.

Grupa: User

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 (14,32 KiB) preuzeto 1232 put(ova).
#8 Objavljeno: 11. 9. 2021. 10:37:47
overlord

overlord

601 svidjanja u 1.382 postova.

Grupa: Moderator

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
  • Novi postovi
  • Nema novih postova