Jester009 Posted December 6, 2007 Posted December 6, 2007 Hi, I'm making a data entry script for my website. In my script when I click a button on my gui it starts entering data. This is done through a FOR loop. My problem is after entering the FOR loop, it ignores all the commands I give eg: closing the gui... It does not respond to any of my commands while inside the for loop. Can anybody help me? Thanks Jester009
DjDeep00 Posted December 6, 2007 Posted December 6, 2007 (edited) Why did u post this twice? You know you can edit your posts rite?Look Here Edited December 6, 2007 by DjDeep00
SpookMeister Posted December 6, 2007 Posted December 6, 2007 Without the code, or at least a small example, nope... cant help, sorry. [u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]
Jester009 Posted December 6, 2007 Author Posted December 6, 2007 Ohh. Didn't know it was posted twise... Sorry my mistake Thanks for the replies guys.. While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop If $msg = $button1 Then For $i=1 to 20 dataEntry() Next EndIf Wend What happens is when I click button1 the script enters the for loop. While its inside the loop, when I click on the close button, the script ignores it.
mikiutama Posted December 6, 2007 Posted December 6, 2007 (edited) try this... While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop If $msg = $button1 Then Opt("GUIOnEventMode", 1) For $i=1 to 20 GUICtrlSetOnEvent($GUI_EVENT_CLOSE, "Exit") dataEntry() Next Opt("GUIOnEventMode", 0) EndIf Wend Func Exit() Exit EndFunc ;==>Exit Edited December 6, 2007 by mikiutama
DjDeep00 Posted December 6, 2007 Posted December 6, 2007 Please click on the link which i posted above.
Jester009 Posted December 6, 2007 Author Posted December 6, 2007 @mikiutama Seems your method is working. Thanks alot. I'm testing it now. Ill keep you posted. Thanks for the support guys
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now