AutoHotkey Community

It is currently May 26th, 2012, 4:17 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: March 22nd, 2009, 1:19 am 
Offline

Joined: October 15th, 2008, 5:29 pm
Posts: 42
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 22nd, 2009, 1:39 am 
Offline

Joined: November 29th, 2008, 12:35 am
Posts: 111
Location: United Kingdom
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
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 22nd, 2009, 1:51 am 
Offline

Joined: March 7th, 2009, 5:37 pm
Posts: 90
Well... what about
Code:
MsgBox, %test%
?

/e @menaphus: a loop9 would obviously not be the same I guess :shock:


Report this post
Top
 Profile  
Reply with quote  
 Post subject: hmm..
PostPosted: March 22nd, 2009, 2:51 am 
Offline

Joined: October 15th, 2008, 5:29 pm
Posts: 42
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 22nd, 2009, 3:18 am 
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.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 22nd, 2009, 4:02 am 
Offline

Joined: October 15th, 2008, 5:29 pm
Posts: 42
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


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, Cerberus, poserpro and 18 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