Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

%a_index% help and nested loops


  • Please log in to reply
1 reply to this topic
justusiv
  • Members
  • 90 posts
  • Last active: Jul 06 2011 03:42 PM
  • Joined: 28 Feb 2006
I am confused on %a_index% and nested loops. lets say i have this code.
#a::
  {
    Loop, 10
      {
        MsgBox %a_index%
        Loop, 10
          {
            MsgBox %a_index%
          }
      }
  }
Return
Would i have to make a var to hold the main loop number like this or is there a different/easier way?

#a::
  {
    Loop, 10
      {		
		Mainloop = %A_Index%
        Loop, 10
          {
            MsgBox %Mainloop% %a_index%
          }
      }
  }
Return


toralf
  • Moderators
  • 4028 posts
  • Last active: Dec 27 2013 01:43 AM
  • Joined: 31 Jan 2005
Nope, you found the right way.