Hi!
I have a use for a random number generator in a V14 VL Web application. With the USE command disabled in VL Web, is there an alternative way in VL Web that I can accomplish this?
Thanks!
Quinton
VL Web - Random Number Generator?
- Stewart Marshall
- Posts: 417
- Joined: Thu Nov 05, 2015 5:25 pm
Re: VL Web - Random Number Generator?
Your only choice in RDML today is to execute a SRVRoutine and generate the number on the server.
Alternatively, you could make a widget with a simple routine that uses the JavaScript Math.random
Alternatively, you could make a widget with a simple routine that uses the JavaScript Math.random
- Stewart Marshall
- Posts: 417
- Joined: Thu Nov 05, 2015 5:25 pm
Re: VL Web - Random Number Generator?
Out of curiosity, how random does the random number need to be?
The Chicken Chase Game example (xDemoWebChickenChase) uses milliseconds to randomise between 1 and 9. If you're only producing a value every so often and it's based on a user action, this is a fairly reasonable technique.
The Chicken Chase Game example (xDemoWebChickenChase) uses milliseconds to randomise between 1 and 9. If you're only producing a value every so often and it's based on a user action, this is a fairly reasonable technique.