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 

Loop with variable - Problem to insert! with %test%count%%

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



Joined: 22 May 2006
Posts: 25

PostPosted: Wed Sep 20, 2006 5:40 pm    Post subject: Loop with variable - Problem to insert! with %test%count%% Reply with quote

Hi,

let's see if someone can help me.
Code:
counter = 0
Loop, 10
{
counter += 1
var%counter% = test
}

Loop, 10

send_counter = 0
{
send_counter += 1
send, %var%counter%%
}

obviously the red line is wrong. Anybody knows how to treat this problem?

Regards

Oliver
Back to top
View user's profile Send private message
Titan



Joined: 11 Aug 2004
Posts: 5376
Location: /b/

PostPosted: Wed Sep 20, 2006 5:46 pm    Post subject: Reply with quote

I think you wanted the braces to be beneath the loop and an array reference:
Code:
send_counter = 0
Loop, 10
{
   send_counter += 1
   send, % var%counter%
}

Note you can use A_Index instead of your own counter.


Last edited by Titan on Wed Sep 20, 2006 5:48 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
Oli00



Joined: 22 May 2006
Posts: 25

PostPosted: Wed Sep 20, 2006 5:47 pm    Post subject: Reply with quote

Of course, you're right!
Back to top
View user's profile Send private message
Oli00



Joined: 22 May 2006
Posts: 25

PostPosted: Wed Sep 20, 2006 6:24 pm    Post subject: Reply with quote

Ok,

I solved the problem by using

send_var := var%counter%
send, %send_var%

Hope this helps someone!

Regards

Oliver
Back to top
View user's profile Send private message
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