dainiusb Posted May 31, 2014 Share Posted May 31, 2014 Local $abc1 = 2 Local $abc2 = 3 Local $abc3 = 4 MsgBox(0, "", $abc & 2) Something like that. $abc + 2 = $abc2 Can this be done in AutoIt? Link to comment Share on other sites More sharing options...
czardas Posted May 31, 2014 Share Posted May 31, 2014 (edited) Yes: Look at Eval() in the help file. Edited May 31, 2014 by czardas Soa 1 operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
dainiusb Posted May 31, 2014 Author Share Posted May 31, 2014 I don't understand how to do it. I see Eval and Assign as completely different things than I need. From examples I understand that Assign is used to assign data to a variable and eval finds out the value but how is this useful? I don't get how it works. Link to comment Share on other sites More sharing options...
Solution MHz Posted May 31, 2014 Solution Share Posted May 31, 2014 Eval takes an expression. This means a string is acceptable rather then an actual variable. Example Local $abc1 = 2 Local $abc2 = 3 Local $abc3 = 4 For $1 = 1 To 3 MsgBox(0, $1, Eval('abc' & $1)) Next All 3 variables are shown in the loop by using the expression of 'abc' & $1 Soa and Neutro 2 Link to comment Share on other sites More sharing options...
czardas Posted May 31, 2014 Share Posted May 31, 2014 That's a better example than the one I was about to post. operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
dainiusb Posted May 31, 2014 Author Share Posted May 31, 2014 Eval takes an expression. This means a string is acceptable rather then an actual variable. Example Local $abc1 = 2 Local $abc2 = 3 Local $abc3 = 4 For $1 = 1 To 3 MsgBox(0, $1, Eval('abc' & $1)) Next All 3 variables are shown in the loop by using the expression of 'abc' & $1 Ooh! Now I see it. Thank You. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now