Pausing scripter makes UI unresponsive under android

I would like to implement long running calls from the scripter and found the Paused property perfect for that.

In a custom scripter method I set Paused := True, do some background work and afterwards I set Paused := False.
Under windows it works perfectly, under android the UI becomes unresponsive until the scripter is unpaused.

I attached a demo project showcasing this behaviour. pause-scripter.zip (11.8 KB)
Observed behaviour:

  • After pressing the "Execute" button, I cannot click into the memo
  • After 10 seconds a message box pops up
  • After closing it it, I can click into the memo and the keyboard shows up

Expected behavior

  • After pressing the Execute button, I can click into the memo and the keyboard shows up
  • After 10 seconds a message box pops up

It would not work in Android.

When Scripter is paused, it enters in a loop until the Scripter is unpaused. During that loop, it calls Application.HandleMessage so that the application continues to be responsive. That is just Delphi code, and it simply works on Windows, but not on Android.

Thank you for the reply.

That is unfortunate, since iOS behaves like Windows and Android seems like an outlier.

I briefly explored the idea of running the scripter in another thread, but because a lot of the script accesses UI components synchronization made it feel really sluggish.
I decided to just use a callback parameter for my long running call instead of trying to pause execution.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.