BenRussell
Programmer
Say I have an array like the following :
@Values = ("3", "8", "2", "0", "23" , "5"
;
And I wanted to randomly select one of the numbers in there (These will not always be the numbers, but I am making an ad rotator program and these will refer to account numbers that contain banner information, etc.) How would I select one of the numbers and assign it to $SelectedValue?
Someone said to use
$SelectedValue = $Values[floor rand @Values];
But this gives an internal server error. I took out the floor, and it does not generate a random number, it picks the same number every time. - Ben Russell
- President of Intracor Technologies (
@Values = ("3", "8", "2", "0", "23" , "5"

And I wanted to randomly select one of the numbers in there (These will not always be the numbers, but I am making an ad rotator program and these will refer to account numbers that contain banner information, etc.) How would I select one of the numbers and assign it to $SelectedValue?
Someone said to use
$SelectedValue = $Values[floor rand @Values];
But this gives an internal server error. I took out the floor, and it does not generate a random number, it picks the same number every time. - Ben Russell
- President of Intracor Technologies (