question

Patrick Zweekhorst avatar image
0 Likes"
Patrick Zweekhorst asked Matt Long answered

Debugging in the script window does not work

Hi,

I wanted to debug some code in my script window. When I press debug from the dropdown at the run button, a code view opens with a red debug circle, but the code is already completed. So I can not step through the code. This problem is in FlexSim 17.0.1.

Thanks in advance

FlexSim 17.0.0
scriptdebug
· 5
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Sam Stubbs avatar image Sam Stubbs ♦ commented ·

That's interesting... I just tried it on my computer and I was able to step through the code just fine. Could you provide an example of your code? Or the situation that you were running the code in?

0 Likes 0 ·
Mischa Spelt avatar image Mischa Spelt Sam Stubbs ♦ commented ·

@Sam Stubbs while they are at it, can they maybe have a look at the debug() statement? I use it, for example, when debugging code in views, since they get copied by createview so it is tricky to set breakpoints there, but it seems like often the debug() statements are ignored and don't bring up the code editor (even though I build the node).

1 Like 1 ·
Patrick Zweekhorst avatar image Patrick Zweekhorst Sam Stubbs ♦ commented ·

Hi,

I tried again, and it looks like it does not work if the first line in the script is a comment. debug.png

Without the "//test" it works fine, but with the "//test" on line 1 it does not

0 Likes 0 ·
debug.png (122.0 KiB)
Sam Stubbs avatar image Sam Stubbs ♦ Patrick Zweekhorst commented ·

Interesting. I'll give the developers a heads up.

0 Likes 0 ·
Show more comments

1 Answer

Matt Long avatar image
1 Like"
Matt Long answered

We are aware that the new compiler does not properly handle putting breakpoints on lines that are not code (ie comments). It's on our dev list to update the code windows so it will automatically find the next line of code if a breakpoint is placed on a comment. If you want to debug code in the script window, make sure the first line is code.

5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.