Thoha Posted August 6, 2007 Share Posted August 6, 2007 I have the following piece of code: For $i = 1 to 10 $newarray[$stringarray[$i]] = "Test" Next The $stringarray contains some different strings, however the size of the array remains to be one in stead of ten :S Any solution to this? Link to comment Share on other sites More sharing options...
lod3n Posted August 6, 2007 Share Posted August 6, 2007 AutoIt arrays can only use non-negative integers for array indexes. If you want to use strings, look for Scripting.Dictionary in the forum search. If you are attempting to fill an array with ten items, try this: Dim $newarray[10] for $i = 0 to 9 $newarray[$i] = "Test" next [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font] 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