PDA

View Full Version : How to jump over loops in thinDebug ?



kcvinu
22-02-2017, 22:41
Hi all,
I was just playing with thinDebug. I would like to know, how can i jump over a loop in thinDebug. For example, i am playing with FileLine_TestReading.tBasic in example folder. It contains a loop to read the text from file. I don't want to waste my time by clicking in "Step in" button. Is there any option to completely step over the loop and go to next section of code ?

ErosOlmi
23-02-2017, 07:48
You can set a breakpoint on the code line you want to jump and then press Run (F5)
9655
Go to the line you want to jump to (it must be a script line, not a comment or empty line). Then set a breakpoint using CTRL + F2 or using the hand button in the toolbar.
Then press Run button or F5 to start automatic execution

thinBasic will execute the script until it will encounter a breakpoint and than stops



Another useful way for complex script is to add breakpoint comments directly into your source script using right click into thinAir and then "Insert Code Block" / "Debugger BreakPoint" or inserting them manually.
9656


Breakpoint comments are special comments starting with '[breakpoint] text. Example:

'[breakpoint] Stops just after main loop

9657

They are intercepted by thinDebug when it starts.

When inside thinDebug, pressing Run (F5) will execute your script but it will stop execution when it encounter a break point.

Hope this help

Ciao
Eros

kcvinu
23-02-2017, 08:06
Hi Eros,
Wow ! Great features. Let me check each of them. Thanks for your answer. :D:)