Steveiwonder Posted January 12, 2010 Share Posted January 12, 2010 (edited) Hello, is it possible to join variables so like this... $i = 0 $downloads = "" $movieLink = "http://somewebsite.com/movie.wmv" While $i < 5 $downloads & $i = InetGet($movieLink, "C:\WCM Downloads\" & $i & ".wmv", 1, 1) sleep(100) $i = $i+1 Wend What im trying to get is for the variable $downloads to become $downloads0, $downloads1, $downloads2. I know its a bad example but is it possible to do so? Edited January 12, 2010 by Steveiwonder They call me MrRegExpMan Link to comment Share on other sites More sharing options...
somdcomputerguy Posted January 12, 2010 Share Posted January 12, 2010 Well once the syntax error in line 10 is corrected, this works (I tested it with consolewrite($downloads & $i)), there might be and probably is a more efficient way of doing this, but I don't know. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
Steveiwonder Posted January 12, 2010 Author Share Posted January 12, 2010 Just missed off the $ before i fixed:) They call me MrRegExpMan Link to comment Share on other sites More sharing options...
Mat Posted January 12, 2010 Share Posted January 12, 2010 Have you read up about arrays? they are the correct way to do as you say. ; First we initialize the array. The 5 is the amount of elements we want. Local $downloads[5] Local $movieLink = "http://somewebsite.com/movie.wmv" For $i = 1 To 5 Step + 1 ; Indexes start from 0! Take one from $i. $downloads[$i - 1] = InetGet($movieLink, "C:\WCM Downloads\" & $i & ".wmv", 1, 1) sleep(100) Next AutoIt Project Listing Link to comment Share on other sites More sharing options...
Steveiwonder Posted January 12, 2010 Author Share Posted January 12, 2010 Yeah though about using an array, but didn't want to get into it as im not brillaint with arrays yet within autoit. but i will look at it. Thanks alot. They call me MrRegExpMan 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