| View previous topic :: View next topic |
| Author |
Message |
TheDanishDragon
Joined: 15 Oct 2008 Posts: 42
|
Posted: Sun Mar 22, 2009 12:19 am Post subject: A_Index inside two loop's? |
|
|
I am currently about to make a dynamic script, and i need to know something about A_Index's behavior inside two loop's.
An exsample:
| Code: |
loop, 3 {
Loop, 3{
test = A_Index ;or %A_Index%, not the most inmportent part..
}
}
|
what would test be? _________________ Mr. HappyDude |
|
| Back to top |
|
 |
menaphus
Joined: 28 Nov 2008 Posts: 111 Location: United Kingdom
|
Posted: Sun Mar 22, 2009 12:39 am Post subject: |
|
|
Wouldnt that be the same as
| Code: |
Loop, 9
{
test = A_Index
}
|
also have you tryed returning the value of test yourself? _________________ Adam
http://moourl.com/8w0tx
 |
|
| Back to top |
|
 |
membersound
Joined: 07 Mar 2009 Posts: 80
|
Posted: Sun Mar 22, 2009 12:51 am Post subject: |
|
|
Well... what about ?
/e @menaphus: a loop9 would obviously not be the same I guess  |
|
| Back to top |
|
 |
TheDanishDragon
Joined: 15 Oct 2008 Posts: 42
|
Posted: Sun Mar 22, 2009 1:51 am Post subject: hmm.. |
|
|
well,
1. the point is no to get 9 loops in total
2. i gues i could use msgbox, and ill try that forgot all about that tecnique, because i havent coded ahk for some time now
/TDD _________________ Mr. HappyDude |
|
| Back to top |
|
 |
Guest
|
Posted: Sun Mar 22, 2009 2:18 am Post subject: |
|
|
| Code: | Loop, 3 {
temp := A_Index
Loop, 3{
msgbox % "OuterLoop: " temp "`nInner Loop: " A_Index
}
msgbox % A_Index
} |
Something like this?
A_Index is taken from the loop it's in.
Notice how A_Index is taken from the outer loop once execution is out of the inner loop. |
|
| Back to top |
|
 |
TheDanishDragon
Joined: 15 Oct 2008 Posts: 42
|
Posted: Sun Mar 22, 2009 3:02 am Post subject: |
|
|
i notice that you use % A_Index or A_Index
whats the advantage of that, and whats the difference between:
1. A_Index
2. % A_Index
3. %A_Index% _________________ Mr. HappyDude |
|
| Back to top |
|
 |
|