We have custom scripts that can run for a long time and are run in a TTask. They are typically doing something like processing a TDataset. Below is an example of a long operation.....
begin
// 10 minute script runtime
while Not(DS.Eof) do
begin
DoStuff;
end;
end.
To minimize the complexity of the script, we would not want the person writing scripts to have to keep checking a GLOBAL variable to see if they should exit early.
Ideally we would have a button in our app that would know the script is running and be able to do something like TatScript.Abort;
to stop the script.
Since we do run the script in a Thread, is there any way to abort a script before it completes.
Note that all our scripts are custom and don't use forms.
Thank you for the consideration of this question.