# Debugging code in main window - stepping through code

**URL:** <https://forum.inductiveautomation.com/t/debugging-code-in-main-window-stepping-through-code/17854>\
**Category:** Ignition\
**Tags:** ignition79, scripting\
**Created:** [April 27, 2018, 7:21pm UTC](https://forum.inductiveautomation.com/t/debugging-code-in-main-window-stepping-through-code/17854 "2018-04-27T19:21:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kcabatic](https://avatars.discourse-cdn.com/v4/letter/k/b19c9b/32.png) [@kcabatic](https://forum.inductiveautomation.com/u/kcabatic)\
**Post date:** [April 27, 2018, 7:21pm UTC](https://forum.inductiveautomation.com/t/debugging-code-in-main-window-stepping-through-code/17854/1 "2018-04-27T19:21:29Z")

</div>

Hi folks,

Just wondering if anyone is aware of a method to step through code within a vision window?

I have encountered issue with my window where hitting the button will cause the designer to just freeze. There is no response from designer; and, it appears to get stuck in an endless loop. I have tried reviewing the code but could not track where is gets stuck. And since designer freezes there are no logs in the console.

A little history, I am importing some VB6 forms that contain about 1000 lines of code. The relevant part of VB6 code was imported as custom methods in the root container which gets called by different components on screen.

Any suggestion on efficient way to step through code?

Thanks,

Ken

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 27, 2018, 7:24pm UTC](https://forum.inductiveautomation.com/t/debugging-code-in-main-window-stepping-through-code/17854/2 "2018-04-27T19:24:02Z")

</div>

There is no stepping debugger.  
Examine your imported functions and make sure nothing is attempting to use DoEvents or otherwise violating the 1/10th second execution time rule for gui event methods.

---

<div class="post-metadata">

**Author:** ![chris3145](https://avatars.discourse-cdn.com/v4/letter/c/96bed5/32.png) [@chris3145](https://forum.inductiveautomation.com/u/chris3145)\
**Post date:** [May 1, 2018, 9:32pm UTC](https://forum.inductiveautomation.com/t/debugging-code-in-main-window-stepping-through-code/17854/3 "2018-05-01T21:32:42Z")

</div>

> And since designer freezes there are no logs in the console.

If you put a `print` command at the very start of the button's code, and you already have the console open before you click the button, can you see it print before it freezes?

---

<div class="post-metadata">

**Author:** ![kcabatic](https://avatars.discourse-cdn.com/v4/letter/k/b19c9b/32.png) [@kcabatic](https://forum.inductiveautomation.com/u/kcabatic)\
**Post date:** [May 7, 2018, 1:59pm UTC](https://forum.inductiveautomation.com/t/debugging-code-in-main-window-stepping-through-code/17854/4 "2018-05-07T13:59:20Z")

</div>

Thanks everyone for the tips,

I actually did end up using print statements and commented the code out by blocks and managed to narrow it down to a single component that was calling calling a function that caused the endless loop
