Pause a script while the mobile OS shows an alert

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
trevix
Posts: 950
Joined: Sat Feb 24, 2007 11:25 pm
Location: Italy
Contact:

Pause a script while the mobile OS shows an alert

Post by trevix » Mon Apr 11, 2022 10:38 am

I have a LC script such as:

Code: Select all

...put false into sWiFiConnected
...put WifiConnectToNetwork(pArray["SSDI"], pArray["Password"]) into sWiFiConnected --become true if WiFi is paired
repeat with U = 1 to 15
          if sWiFiConnected AND "192." is in the networkInterfaces then
               exit repeat
          end if
          wait 1 seconds with messages
end repeat
I have noticed that, if the mobile OS shows an alert (in my case...do you want to connect to this WiFi...) while the script is doing the loop, the LC script keep running anyway in the background.
This is making very difficult to time the user interaction. If he waits too long to press "OK", the loop will go to the end with sWiFiConnected = false.
But the pairing to wifi has been done.
Is there any way to pause a script while the OS is showing an alert?
Trevix
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”