Dinosaurr Posted January 26, 2009 Share Posted January 26, 2009 Global $Line[12] For $i = 1 to 12 Step +1 $Line[$i] = FileReadLine("ipaddresses.txt", $i) Next For $i = 1 to 12 Step +1 ShellExecute("lol.exe", $Line[$i] & " 0") Sleep(2000) Next I was trying to get this to run, but i get that error when ever i try to run Link to comment Share on other sites More sharing options...
Authenticity Posted January 26, 2009 Share Posted January 26, 2009 (edited) Array's first index is always 0 and grow up to array's size minus 1 so $Arr[5] is $Arr[0] through $Arr[4] which is the last subscript. Edited January 26, 2009 by Authenticity Link to comment Share on other sites More sharing options...
Dinosaurr Posted January 26, 2009 Author Share Posted January 26, 2009 Array's first index is always 0 and grow up to array's size minus 1 so $Arr[5] is $Arr[0] through $Arr[4] which is the last subscript. Ahhh, i got it. thanks. Link to comment Share on other sites More sharing options...
Authenticity Posted January 26, 2009 Share Posted January 26, 2009 You don't need to use 'Step +1' because it's the default behavior. The problem here is that you don't know how much lines there will be so use some mechanism to ReDim the array or if you want you can use _FileReadToArray which returns 1 on success and the submitted array's first subscript $Array[0] containing the number of records then it can be accessed like this: For $i = 1 To $Array[0] ; Do something here Next 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