GLBasic forum

Main forum => FAQ => Topic started by: Roy on 2013-Mar-02

Title: Debug Mode
Post by: Roy on 2013-Mar-02
Hi I am new to GL BAsic but do not understand how to use the GUI debug mode other than to hit the debug icon and then compile the program. How can I then step through each instruction? :nw:
Title: Re: Debug Mode
Post by: mentalthink on 2013-Mar-02
HI Roy the first Wellcome to the boards...

About using debug or not, you only have to pick the icon on appears

But if you want look whats happends in your code, you have to put this commands... Debug (See in the Help, press F1)

Then in the Compiler part, this it's the bottom part of the screen in my image it's a white part, you can test the values you want see...

I know whit debugger you can do more things, but really I never use... Be carefully in large Codes you have to wait a bit more than if you don't use debug...

Don't care any master will give you a more intersting answer than me, soon!!! don't care!.

Wellcome again, and enjoy of all the Community and GLbasic...

Iván J.

Title: Re: Debug Mode
Post by: hardyx on 2013-Mar-02
To use to Debug features you must to compile the app with debug activated. Then you can put breakpoints, wich are when you want to stop in the code execution and examine what's happening there. You can execute the code until you reach the breakpoint. You can see the values of active variables in the debug tab of the editor when you stop in a breakpoint. You can continue the execution, or you can go step by step watching the instructions executed and the variable values. This is very useful if some routine not works like you want or returns an unexpected value.

Here you can see at the margin of the code a breakpoint (in red) and the current execution point (in yellow).

(http://www.glbasic.com/gfx/editor_en.png)
Title: Re: Debug Mode
Post by: MrTAToad on 2013-Mar-02
In addition, the DEBUG statement is also very useful, as that outputs text in the Output window section of the IDE
Title: Re: Debug Mode
Post by: Roy on 2013-Mar-03
Quote from: hardyx on 2013-Mar-02
To use to Debug features you must to compile the app with debug activated. Then you can put breakpoints, wich are when you want to stop in the code execution and examine what's happening there. You can execute the code until you reach the breakpoint. You can see the values of active variables in the debug tab of the editor when you stop in a breakpoint. You can continue the execution, or you can go step by step watching the instructions executed and the variable values. This is very useful if some routine not works like you want or returns an unexpected value.

Here you can see at the margin of the code a breakpoint (in red) and the current execution point (in yellow).

(http://www.glbasic.com/gfx/editor_en.png)
Yes I can see the execution point and the breakpoint but how do you insert the breakpoint?
Title: Re: Debug Mode
Post by: Moru on 2013-Mar-03
F9 or the menus Edit->Breakpoints
Title: Re: Debug Mode
Post by: Roy on 2013-Mar-03
 =D Thank you for the info - I will now recommend the program to a friend of mine  :)
Title: Re: Debug Mode
Post by: erico on 2013-Mar-03
I thank you guys too, I never used debug mode, now I know a bit more about it! :good: