Hi all,
please forgive me if I ask a question which could have been asked before, where the answer may be somewhere on page xxx of some doc, or which I could probably have solved myself. I am right now not allowed to spend time using FPC by order from above, seems there isn't much trust there when a product doesn't cost $$$$$ and is backed by some well known company name. I just ran into a wicked problem using some other so-called technology (web ... Javascript), using a framework from one of those well known companies, wasted a lot of time and still haven't found a satisfying solution, and wonder whether there would be a better solution in Lazarus/FPC.
The problem is, in a event driven program, to abort a long running task from the GUI. The only option I have right now (in the programming environment I am forced to use) is that I can set a global flag variable, and spread queries all over the long running task code. As soon as the code hits into one of those many queries, I can try to abort the task code. There are two problems with this: if the long running task spends time in a sleep state, it won't abort until the current sleep has reached its limit, given I put queries to my variable right after every sleep. The second problem ist that the environment I currently am forced use doesn't fire a separate task when one hits a button, but queues the button press message in some main task event loop, where it resides until the long-running task has returned. Pressing some abort button thus doesn't have any effect, since it's handling routine won't be called until the long running task returns, and so the mnagic variable cannot be set before the task has finished anyway.
Simple question: does Lazarus/FPC better, and if yes, where can I read more about it?
Thx, Armin.