Isappterminated not working?

Hi I’ve got a simple loop that looks like this

$istop = 0;

do {

// various file input and output

if (exo_getglobalvariable(“isappterminated”, “0”) == “1”) {
$istop=1;
}

} while($istop==0);

exit;

But when it runs, and I say exit the application by file -> close or clicking on the normal exit window button, the application continues in the loop, as if the isappterminated is never triggering. Running it with the Trident browser engine - multithreading on. Please can someone tell me what I am doing wrong ?

The rest of the application runs fine,only problem is shutting it down.

Many thanks.

Ignore this - problem down to myself, there was an inner loop too - whoops :slight_smile: Works fine.