Horrace 10 Posted July 19, 2009 Hi, Normally people use select with literal 0,1,2 etc. Is it possible to use a variable eg. _index = 0; _unit = _this select _index I've tried but doesn't appear to work. It's late maybe i'm just missing something. (Probably sleep) Thanks, Share this post Link to post Share on other sites
kylania 568 Posted July 19, 2009 You're including a ; at the end of the second line right? Share this post Link to post Share on other sites
Horrace 10 Posted July 19, 2009 Yep. That was just an example. Share this post Link to post Share on other sites
Big Dawg KS 6 Posted July 20, 2009 You can use any variable or expression that evaluates to a number. Why your example doesn't work isn't clear. Perhaps _this isn't an array. Share this post Link to post Share on other sites
Horrace 10 Posted July 20, 2009 My fault. I was trying to do this : _myArray = [0,0,0]; _value = 2; (_myArray select _value) = 5; Thinking that this would set the second element to 5. What I should have done is _myArray set[_value,5]; Doh! Share this post Link to post Share on other sites