Sign in to follow this  
Followers 0
gerym

Help loop the seacrh...

5 posts in this topic

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 :)

Share this post


Link to post
Share on other sites



HotKeySet("{F1}", "A")
HotKeySet("{Esc}", "_End")



Func A()
While 1
; code goes here
WEnd
EndFunc

Func _end()
Exit
EndFunc

Share this post


Link to post
Share on other sites

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 .

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 :)


√-1 2^3 ∑ π, and it was delicious!

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