Jump to content

Recommended Posts

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

They call me MrRegExpMan

Posted

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.

Posted

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
Posted

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

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
×
×
  • Create New...