Sign in to follow this  
Followers 0
daslick

random selection from array?

4 posts in this topic

My array is $proxylist....

it has a range of [1] to [20]

I am trying to get a random one sent to a variable.

This is the line that I have, but does not work.

$testvar = '$proxylist' & "[" & random(1,20,1) & "]"

I hate arrays. They can die.

Share this post


Link to post
Share on other sites



Thanks.....

It worked... here's what I'm using it for

$proxylist = _ArrayCreate("1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20")
            GUICtrlSetData($proxyinput,$proxylist[random(0,19,1)])

Share this post


Link to post
Share on other sites

No need to _arraycreate. You can just do...

Dim $proxylist[20] = ["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20"]

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  
Followers 0