Using Build button on the IDE

Dear friends,

First of all I want to excuse myself because this probably is not a bug but my error.

I have a medium size application in Windows using OptimizationLevel = 4 because I need it. So compilation time can be long (some minutes).

If I click on “Build” or I click CTRL-C without wanting it (errare humanum est) the compilation begins and although there is a window with a “Cancel” button, no matter if I click on it thousand times: NOTHING HAPPENS, at least immediately.

I have to wait some time until Xojo disappears.

It is very strange that nobody said anything about it, that’s why I think it should be my error.

Is there anyone using Windows and OptimizationLevel = 4? Please say something.

There are several possibilities: 1) It is a bug 2) It is my error 3) It is not a bug but using Windows and OptimizationLevel = 4, it is the way it should be.

No matter which case it is, I think that the “Cancel” button should work immediately. And I would move the Build button of the IDE away from the Run button so that there was no possibility to make a mistake.

If it is my error I would thank your comments on how I should do it.

Not your fault. We just accepted that the IDE only reacts to it at the end of every major process (if at all)…

Give this case an upvote:
https://tracker.xojo.com/xojoinc/xojo/-/issues/69803

FWIW, The cancel button sets a flag that says “when you get to the next cancelable point, please stop”.

That said, did you know that you can show a dialog asking whether you really want to build?

If ShowDialog("build?", "", "Yea", "Nah", "", 0) = "Nah" then
CancelBuild 
End If

Several open and closed Issues about this:
https://tracker.xojo.com/xojoinc/xojo/-/issues/68699
https://tracker.xojo.com/xojoinc/xojo/-/issues/69265
https://tracker.xojo.com/xojoinc/xojo/-/issues/73332
https://tracker.xojo.com/xojoinc/xojo/-/issues/77414
besides the one posted already by StefanA

Thank you very much for all the answers. At least I have it clear what happens. I was practically sure it was my fault as it is. Now I will try to cancel before compiling.

No, I didn’t know it. But I find the idea very good, the only problem is: Where and how is it done?

Add to build settings - script.
Make sure that is above the Build.

Thank you very much. It works!