I came across a website today, www.random.org, and decided to make a function in alpha to generate random integers using the random.org web client. This should give you true random numbers.
So attached is the database that contains the RandNums() function
The limitations for Random.Org's Integer Generator are....
Amount of Random Integers <= 10,000
Integer Range = +/- 1,000,000,000
(Alpha limitations are probably less than this, not sure what the limitations of the characters data types are in xBasic but I assume it's about 1,024 bytes?)
Happy Randomizing
Won't let me attach .zip of DB because I already posted in on another thread. HEre is the URL to that Thread
Random Number Thread Link
Here is the code for the function I used.
Parameter Limitations set by random.org...
vMyNum <= 10,000
vMyMin >= -1,000,000,000 .and. <= 999,999,999
vMyMax >= -999,999,999.and. <= 1,000,000,000
p.s. - please share any fixes or improvements
So attached is the database that contains the RandNums() function
The limitations for Random.Org's Integer Generator are....
Amount of Random Integers <= 10,000
Integer Range = +/- 1,000,000,000
(Alpha limitations are probably less than this, not sure what the limitations of the characters data types are in xBasic but I assume it's about 1,024 bytes?)
Happy Randomizing
Won't let me attach .zip of DB because I already posted in on another thread. HEre is the URL to that Thread
Random Number Thread Link
Here is the code for the function I used.
Parameter Limitations set by random.org...
vMyNum <= 10,000
vMyMin >= -1,000,000,000 .and. <= 999,999,999
vMyMax >= -999,999,999.and. <= 1,000,000,000
Code:
'Date Created: 25-Jan-2011 04:28:47 PM 'Last Updated: 25-Jan-2011 04:28:47 PM 'Created By : Lee Goldberg - Shore Consultants Ltd 'Updated By : Lee Goldberg - Shore Consultants Ltd FUNCTION RandNums AS C (vMyNum AS N,vMyMin AS N,vMyMax AS N) DIM vp as p DIm vurl as c DIM vbody as c DIM vresponse as c DIM vReturn as c vurl = "http://www.random.org/integers/?num="+vMyNum-"&min="+vMyMin-"&max="+vMyMax-"&col=1&base=10&format=plain&rnd=new" vbody = "" vp = http_post(vurl,vbody,"",80,2800,.f.) ' msgbox("vp",vp.body) vresponse = *HTML_TO_PLAIN(vp.body) if left(vresponse,10) = "RANDOM.ORG" then msgbox("Error!","Parameters do not meet criteria") vReturn = "Error! Please try again" else vReturn = alltrim(vresponse) end if RandNums = vReturn END FUNCTION
p.s. - please share any fixes or improvements