|
-
Oct 7th, 2001, 09:09 PM
#1
Thread Starter
Addicted Member
randomize not working
Why is this not picking a random song for me? It worked like once, then kept playing the same song..
VB Code:
If mpMain.PlayState = mpStopped Then
UpperBound = Upper + 1
LowerBound = 0
Upper = UBound(arrSongs)
Randomize
SongNum = Int((UpperBound - LowerBound + 1) * Rnd + LowerBound)
NAAAS.mpMain.Filename = arrSongs(SongNum)
Text2.Text = arrSongs(SongNum)
End If
-
Oct 7th, 2001, 09:20 PM
#2
Addicted Member
LowerBound never changes, it's always 0. Not sure if it'd change anything, but, something to point out.. you might as well just use hard code numbers, rather than variables for them.
The answer is 42. Sadly, you can't typecast the "answer" data type to the "question" data type.
Code:
Take.Me( To( Your.Leader ) )
-
Oct 7th, 2001, 09:22 PM
#3
Thread Starter
Addicted Member
I can't hardcode the numbers. Cause the array it uses is not always the same size..
-
Oct 7th, 2001, 09:26 PM
#4
Addicted Member
try this
VB Code:
Randomize Timer
SongNum = Int((CSng((UpperBound - LowerBound) + 1) * Rnd) + LowerBound)
"1 4m 4 1337 #4xz0r!'
Janus
-
Oct 7th, 2001, 09:32 PM
#5
Thread Starter
Addicted Member
It still plays the same two songs.. Same as before also. So ther must be something else cause it to lean to thoes two songs.. But what is it?
-
Oct 7th, 2001, 09:35 PM
#6
Addicted Member
That's because UpperBound is probably 1.
Make it UBound(arrSongs) instead of Upper + 1.
"1 4m 4 1337 #4xz0r!'
Janus
-
Oct 7th, 2001, 09:54 PM
#7
Thread Starter
Addicted Member
I got it working. I was just loading a small list and by chance getting the same songs.. I think. It seems to be working now. thanks..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|