AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

User defined Loop count

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Zvi



Joined: 22 Aug 2008
Posts: 25

PostPosted: Fri Aug 22, 2008 12:39 pm    Post subject: User defined Loop count Reply with quote

Is there a way to have a simple loop of any action but with an 'n' times for the loop? Then when the script is run, an input window pops up, asking the user how many times he wants the action to loop?

Thanks
Back to top
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 6264

PostPosted: Fri Aug 22, 2008 12:42 pm    Post subject: Reply with quote

Code:
n = 1000
Loop %n%


Smile
_________________
Back to top
View user's profile Send private message
poo_noo



Joined: 08 Dec 2006
Posts: 137
Location: Sydney Australia

PostPosted: Fri Aug 22, 2008 12:49 pm    Post subject: Reply with quote

tested
Code:
InputBox, N, Loops, Please tell me how many loops to do, , ,
Loop, %N%
{
    MsgBox, Loops requested is %N%`nLoop number is %A_Index%.
    Sleep, 100
}

_________________
Paul O
Back to top
View user's profile Send private message Visit poster's website
Guest






PostPosted: Fri Aug 22, 2008 12:56 pm    Post subject: Re: User defined Loop count Reply with quote

Zvi wrote:
Is there a way to have a simple loop of any action but with an 'n' times for the loop? Then when the script is run, an input window pops up, asking the user how many times he wants the action to loop?

Thanks

A simple example:
Code:
InputBox, count, Loop Tester, Enter number of loops to do.

loop, %count% {
  ; put your actions here
  tooltip, Loop #: %A_Index%
}
MsgBox, Loop Tester Done

Smile
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group