Re: [random] only for 1-100???
This WebDNA talk-list message is from 1997
It keeps the original formatting.
numero = 13299
interpreted = N
texte = =>>>>>Is there anyway to specify the range of numbers [random] uses,rather than>>>>>the default 1-100?>>>>>>Use some math on the random number before you use the resulting>>>>number for your particular needs ... :)>>>>>Sure, sure. However, I was hoping just maybe I wouldn't have to massage>>>my data every time I need a random value other then between 1-100. Geez,>>>even Basic 2.0 on my old Commodore 64 had an RND function...>>>>All it takes is writing the WebDNA once, and then you have a solution>>you can re-use forever with minimal changes to accommodate your>>specific needs ... provided you write it right the first time.>Maybe you can give me a few hints? I'm not sure where to start in order to>make a proper random number generation routine which would be repurposable.>I'd need something that would handle everything from easy stuff like 1-10>to things like 16-536. I think this would be handy code to have.When I've programmed this into other database software, I usuallybegin with the random number capabilities provided in the software,then I decide how to use that random number (with some math) togenerate a random number from a defined range of values.If you want, I will write this random number WebDNA for WorldPointso it works with whole numbers (not fractions) in exchange for thismonth's colocation fee (talk to James for approval) ... and thenyou'll be able to do exactly what you want in terms of selectingranges of numbers, such as the 16-536 example above.Your only need from then on will be to figure out how to get thecorrect minimum and maximum values into the variable I create forthem in the WebDNA code.How's that for a great deal! :)Sincerely, Ken GromeWebDNA Solutionshttp://www.hui.net/dna/webdna.html
Associated Messages, from the most recent to the oldest:
=>>>>>Is there anyway to specify the range of numbers
[random] uses,rather than>>>>>the default 1-100?>>>>>>Use some math on the random number before you use the resulting>>>>number for your particular needs ... :)>>>>>Sure, sure. However, I was hoping just maybe I wouldn't have to massage>>>my data every time I need a random value other then between 1-100. Geez,>>>even Basic 2.0 on my old Commodore 64 had an RND function...>>>>All it takes is writing the WebDNA once, and then you have a solution>>you can re-use forever with minimal changes to accommodate your>>specific needs ... provided you write it right the first time.>Maybe you can give me a few hints? I'm not sure where to start in order to>make a proper random number generation routine which would be repurposable.>I'd need something that would handle everything from easy stuff like 1-10>to things like 16-536. I think this would be handy code to have.When I've programmed this into other database software, I usuallybegin with the random number capabilities provided in the software,then I decide how to use that random number (with some math) togenerate a random number from a defined range of values.If you want, I will write this random number WebDNA for WorldPointso it works with whole numbers (not fractions) in exchange for thismonth's colocation fee (talk to James for approval) ... and thenyou'll be able to do exactly what you want in terms of selectingranges of numbers, such as the 16-536 example above.Your only need from then on will be to figure out how to get thecorrect minimum and maximum values into the variable I create forthem in the WebDNA code.How's that for a great deal! :)Sincerely, Ken GromeWebDNA Solutionshttp://www.hui.net/dna/webdna.html
Kenneth Grome
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
webcat NT (1998)
PCS Frames (1997)
PCS Frames (1997)
convertchars and e-mail (1998)
WebDNA5 & Tiger (2006)
WebCatalog 2.0 & WebDNA docs in HTML ... (1997)
Formatting time output (2000)
[WebDNA] Code works in v6 but not in v7 (2010)
authenticating a second user (1997)
WCS Newbie question (1997)
OT: Email Spam a bit of Hell (2004)
Webcat Manual and TeaRoom Examples Uses Different Examples. (1997)
Command=FlushDatabases Question... (2001)
[/application] error? (1997)
More on [purchase] (1998)
Conversion Database Blues (2001)
remotely add + sign (1997)
Protect and Serve (1999)
WebCatalog Technical Reference (1997)
To Err or Not Custom Error (1999)