Created
July 7, 2016 13:43
-
-
Save jbratu/cc74c5dc24443d65278bfc990a97be19 to your computer and use it in GitHub Desktop.
The OpenInsight random number generator is pseudo-random and running simultaneous sessions on the same computer can result in the same random number results. This snippet calls the JScript random number generator.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
common /csRnd/ WScript, init% | |
If Assigned(init%) Else init% = '' | |
If init% else | |
WScript = oleCreateInstance("ScriptControl") | |
OlePutProperty(wscript, "Language", "JScript") | |
s = 'function getrandom() {return Math.random();}' | |
x = WScript->AddCode(s) | |
init% = 1 | |
end | |
RetVal = WScript->Eval("getrandom();") * 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment