Execution stops on break statement

Hi,

I’m having issues when using the break statement. When running my applicatie from within Xojo, execution halts on each break statement, like it has a break point in front of it. For each halt, I have to press the resume button.

Breakpoints is set to “ignore all”. “Break on exceptions” is disabled.

Running the app from the finder, all works well.

I’m using the latest version of Xojo on Os X 10.14

i think break is not the same as a break point which you set in front of a line in editor.
you can use a boolean variable and a condition for your break in debugging.

@Tim Melis — Unlike breakpoints, “Break” unconditionally breaks into the debugger, if one is attached to the process. As a consequence, it breaks when running your app from Xojo but not when launched from the Finder because no debugger is attached in that case.

@Stphane Mons - Thanks for your feedback. It seems I was using the wrong command. I should have been using “Exit” to exit a for loop…

And explain you use break to exit from a loop :wink:

Edit: LR links
http://documentation.xojo.com/api/code_execution/for...next.html
http://documentation.xojo.com/api/code_execution/for_each...next.html

Strange how Xojo didn’t rename/repurpose the ‘BREAK’ statement, since many other languages use it for just the purpose the OP had thought it was for. Of course doing so would “BREAK” a lot of old code