Debugging a Function

Debugging a Function - How to debug a function - Messages

#1 Posted: 8/17/2020 2:37:14 PM
Ryan Freund

Ryan Freund

19 likes in 339 posts.

Group: User

Is it possible to find an error in a function with program debugging features? Meaning - the program stops and highlights errors in red. If there is an error in a function it stops and reports the error where the function is called. Is it possible to have some sort of indicator within the function?

In my specific case I have a large function that is reporting that the number of rows and/or columns of matrices do not match. I have many matrices / variables to go thru and having a hard time spotting the culprits.

Thanks!
#2 Posted: 8/17/2020 3:58:17 PM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

To display the debugger window: View> Debugger window
This shows the definitions valid in the current execution context.

To step through the sheet use the Continue and Step into buttons in the toolbar (or simply F11)

To pause on error (to inspect debug window) set: Calculation> On error> pause

You also can set breakpoints (context menu of math regions).
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
2 users liked this post
sergio 8/17/2020 4:31:00 PM, Ryan Freund 8/18/2020 9:15:00 AM
#3 Posted: 8/17/2020 6:27:31 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Construct piece-wise to sanity piece-wise.
Deceptively simple !
#4 Posted: 8/18/2020 4:18:11 AM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1674 posts.

Group: User

Hi. I prefer the use of trace: https://smath.com/wiki/trace.ashx at some strategic points to see the procedure internal values and if they are what I expect.

Best regards.
Alvaro.
  • New Posts New Posts
  • No New Posts No New Posts