Jump to content

Recommended Posts

Posted

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

Posted

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 .

Posted

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
  • Moderators
Posted

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!

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
×
×
  • Create New...