Jump to content

Joining Variables?


Recommended Posts

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

Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...