Sign in to follow this  
Followers 0
Jester009

Exit while inside a FOR loop...

9 posts in this topic

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Why did u post this twice? You know you can edit your posts rite?

Look Here

Edited by DjDeep00

Share this post


Link to post
Share on other sites

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]

Share this post


Link to post
Share on other sites

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.

:)

Share this post


Link to post
Share on other sites

#7 ·  Posted (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 by mikiutama

Share this post


Link to post
Share on other sites

Please click on the link which i posted above.

Share this post


Link to post
Share on other sites

@mikiutama

Seems your method is working. Thanks alot.

I'm testing it now. Ill keep you posted. Thanks for the support guys

:)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0