gerym Posted November 22, 2012 Share Posted November 22, 2012 I have a Func A() ... I want when I start my program it loops until I close the program ... I'm newbie in AutoIT . I've tried with "while ...Wend" and "do...while" but it doesn't work. help plz Link to comment Share on other sites More sharing options...
Gotemp Posted November 22, 2012 Share Posted November 22, 2012 HotKeySet("{F1}", "A") HotKeySet("{Esc}", "_End") Func A() While 1 ; code goes here WEnd EndFunc Func _end() Exit EndFunc Link to comment Share on other sites More sharing options...
gerym Posted November 23, 2012 Author Share Posted November 23, 2012 Thanks all . Code of seeker worked. and the other didn't . when i start the program nothing happen even when click Hotkey . it runs in about 2 seconds then auto close and return the scite . Link to comment Share on other sites More sharing options...
Gotemp Posted November 23, 2012 Share Posted November 23, 2012 Ooops, sorry i wrote this then headed straight to bed, if you check the code you will see i added a second function, Hotkey and another while. Also were all "Seekers" as thats forum rank not forum name, sorry for the bad code like i said was tired. Func A Will open a MsgBox over and over press ESC to end it. Func B will show the MsgBox once because of the "Return" attribute added press F2 to show it again. _Exit just exits the whole program, i always add this. HotKeySet("{F1}", "A") ; Starts function A HotKeySet("{F2}", "B") ; Starts function B HotKeySet("{Esc}", "_End"); Exit While 1 sleep(100) ; So HotKeys are avaliable. Wend Func A() ; Example of while 1 loop. While 1 msgbox(0, "", "a") WEnd EndFunc Func B() ; Example of while 1 loop with return added. While 1 msgbox(0, "", "B") return WEnd EndFunc Func _end() Exit EndFunc Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted November 23, 2012 Moderators Share Posted November 23, 2012 Gerym, this question looks incredibly similar to your post That post was locked as it violated the forum rules; hope you're not trying to re-ask the same question "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
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