Hey guys,

I got a thread here (TFetchData = class(TThread)) which downloads a bunch of xml and then process's it and sticks it into a database. All working well, however I want the user to be able to abort/terminate the process...

So one think I did is setup a global varaible - gbTerm : boolean;
And in my thread.execute I would do this
If gbTerm = true then terminate;

However that didn't quite work as expected (ie, nothing happened, thread still ran).

So then I tried

var
MyThread : TFetchData;
begin
MyThread := TFetchData.create('myname');
end;

button2
begin
MyThread.Terminate;
end;

same result as above (to be expected ofc).

So im just wondering... how should I terminate this thread?

Thanks
Nick
_______________________________________________
Delphi mailing list
[email protected]
http://ns3.123.co.nz/mailman/listinfo/delphi

Reply via email to