Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

How to exit in the loop

$
0
0
Hello guys, need some simple help here.

Global $site = "http://www.bing.com"
Global $up= Ping("www.bing.com")

HotKeySet("{ESC}", "_Exit")

if $up = 0 Then
   $msg = GUIGetMsg()
   do
   $up= Ping("www.bing.com")
   sleep(2000)
   Until $up <> 0 or $msg = $GUI_EVENT_CLOSE Or $msg = $Cancel


Func _Exit()
	Exit
 EndFunc   ;==>_Exit



This is my coding, when the interface started and when there's no network connection, it will keep looping until there's network connection. While in the looping, when click on the GUI cancel button or window close event, the script will stop running and exit. My problem here's i couldnt click the cancel button nor the window close event to exit. I only managed to press the "{ESC}" to terminate the script. Appreciate someone can help me. i tried many times but i failed and gave up.

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>