| View previous topic :: View next topic |
| Author |
Message |
Oli00
Joined: 22 May 2006 Posts: 25
|
Posted: Wed Sep 20, 2006 5:40 pm Post subject: Loop with variable - Problem to insert! with %test%count%% |
|
|
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 |
|
 |
Titan
Joined: 11 Aug 2004 Posts: 5376 Location: /b/
|
Posted: Wed Sep 20, 2006 5:46 pm Post subject: |
|
|
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 |
|
 |
Oli00
Joined: 22 May 2006 Posts: 25
|
Posted: Wed Sep 20, 2006 5:47 pm Post subject: |
|
|
| Of course, you're right! |
|
| Back to top |
|
 |
Oli00
Joined: 22 May 2006 Posts: 25
|
Posted: Wed Sep 20, 2006 6:24 pm Post subject: |
|
|
Ok,
I solved the problem by using
send_var := var%counter%
send, %send_var%
Hope this helps someone!
Regards
Oliver |
|
| Back to top |
|
 |
|