There is a way around this. You make a stop button in the UI, in that stop button you set a variable (in my example i called it #shallistop) and then throughout your loop you use the if statement to check if the variable is set to YES, then when you press the stop button the loop will stop! no need to wait for it to finish. Here is a little example for you.
ui stat monitor("Loop", #loopnumber)
set(#shallistop, $nothing, "Global")
set(#shalistop, $nothing, "Global")
set(#loopnumber, 0, "Global")
ui button("STOP") {
set(#shalistop, "YES", "Global")
}
loop(999999) {
if(#shalis