AutoHotkey Community

It is currently May 27th, 2012, 12:33 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: December 8th, 2009, 11:34 pm 
Offline

Joined: October 29th, 2006, 4:09 am
Posts: 39
Location: A2 MI
So this seems like it ought to be ridiculously simple.

Code:
CapsLock & q::
{
   var = 1
   num = 5

   while var < num
   {
      MouseMove 400,400
      Sleep 1000
      GoSub Capslock & u
      Sleep 5000
      GoSub Capslock & i
      Sleep 5000
      GoSub Capslock & y
      Sleep 7000
      MouseMove 500,500
      var := A_Index
   }
   MsgBox %var%
   
}


The MsgBoxes are just my trying to identify the problem....

It complains that "while var < num is not a recognized action...

If I put parentheses around the var < num, It goes through the while loop once, and outputs 0 for %var%. So not actually following the while loop... (A_Index starts at 1 if inside a loop, i think)

What stupid mistake am I making?

Thanks.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 8th, 2009, 11:41 pm 
Code:
CapsLock & q::
{
   var = 1
   num = 5

   while var < num
   {
      var := A_Index
       MsgBox %var%
   }

   
}

works

i think it is related with the GoSub, u need to create a label for it, it is different than the hotkey that u just define


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 8th, 2009, 11:54 pm 
Offline

Joined: October 29th, 2006, 4:09 am
Posts: 39
Location: A2 MI
Anonymous wrote:
Code:
CapsLock & q::
{
   var = 1
   num = 5

   while var < num
   {
      var := A_Index
       MsgBox %var%
   }

   
}

works

i think it is related with the GoSub, u need to create a label for it, it is different than the hotkey that u just define


Copy/pasting above still throws the same error :/

And I know the GoSubs are working fine. And still get the error if I comment these out.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 8th, 2009, 11:56 pm 
Offline

Joined: October 29th, 2006, 4:09 am
Posts: 39
Location: A2 MI
I was under the impression I had the September update on this computer. I guess my USB drive install has it, instead... (was v1.0.47ish and while is new in .48...)

Thanks for the help.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: chaosad, Exabot [Bot], Google Feedfetcher, jrav, Yahoo [Bot] and 22 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group