Jump to content
Sign in to follow this  
Steveiwonder

Joining Variables?

Recommended Posts

Steveiwonder

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 by Steveiwonder

They call me MrRegExpMan

Share this post


Link to post
Share on other sites
somdcomputerguy

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.

Share this post


Link to post
Share on other sites
Steveiwonder

Just missed off the $ before i fixed:)


They call me MrRegExpMan

Share this post


Link to post
Share on other sites
Mat

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

Share this post


Link to post
Share on other sites
Steveiwonder

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

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.