02-15-2019, 05:49 PM
(02-14-2019, 09:41 PM)Alexandre Machado Wrote: You can have a look at IWMonitor. There is a demo here:
https://github.com/Atozed/IntraWeb/tree/...IWMonitor2
IWMonitor is a kind of "lightweight" timer with a few more options. The good thing about it is that it doesn't lock the user session session.
IWMonitor basically watches a WebApplication property (named "Status") for changes. Whenever Status change, it will trigger an event. When the status equals a "target" value it also trigger events and you can respond to that.
Please have a look and let me know if you need further help
IWMonitor did exactly what I needed.
Code:
IWMonitor1.Enabled := true;
tthread.CreateAnonymousThread(
procedure
begin
salesSearchRequest.Execute;
webapplication.Status.Value := 100;
end).Start;Code:
procedure TIWForm117.IWMonitor1AsyncTimer(Sender: TObject; EventParams: TStringList);
var
idx: integer;
begin
webapplication.Status.Value := 0;
IWMonitor1.Enabled := false;
if assigned(salesProSearchRequest) then
begin
doStuff;
iwmemo1.lines.add('Finished');
end;
end;Knowing I can do that... makes things pretty interesting

Since I use tthread.CreateAnonymousThread all the time now for iOS/Android usage in FMX, I make a huge fan of it.
Thanks for the heads up!

