teh jimpie Posted January 8, 2011 Author Share Posted January 8, 2011 heyhow do i get a random number in visual basic?e.g. a number between 0 and 50like in eclipse stable, but thats not working; Rand(0, 50)thanks Link to comment Share on other sites More sharing options...
EclipseCommunity Posted January 8, 2011 Share Posted January 8, 2011 That's because Rand() is not a built-in function in Visual Basic. You will need to find the Rand() fuction routine in the source code and copy/paste it to origins. Link to comment Share on other sites More sharing options...
Guest Posted January 8, 2011 Share Posted January 8, 2011 You could try Rnd()I don't have a source code to look at right now unfortunately but something like this usually works.Int(Rnd * 50) + 1 Link to comment Share on other sites More sharing options...
Robin Posted January 9, 2011 Share Posted January 9, 2011 Rand works just fine in EO. Link to comment Share on other sites More sharing options...
teh jimpie Posted January 9, 2011 Author Share Posted January 9, 2011 ```Public Function Rand(ByVal Low As Long, ByVal High As Long) As Long Rand = Int((High - Low + 1) * Rnd) + LowEnd Function ```ah thanks :) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now