Re: Unique value creation
This WebDNA talk-list message is from 1999
It keeps the original formatting.
numero = 23236
interpreted = N
texte = I was thinking about the same problem a few weeks ago. I was going to tryand use a combination of days/hours/mins/secs to establish a start value,then multiply that value times ten and then add a random number formattedto two digits. So that the result would be:days/hours/minsXX where xx would come from the random function. Is thatachievable?Math functions always tax my feeble mind so I havn't gotten around toactually writing the WebDNA and trying this idea out.Marty SchmidArtwerks>I can use the number of days/hours/mins/secs in some form or other to>create a *nearly* unique identifier number for each user, but how do I>create a truly unique value for two people who access the site during the>exact same second in time?>>It seems both of these users will have the exact same value, so it won't>be unique -- unless I tack on some kind of sequential index number that>simply cannot be re-used again during the same second in time, even by>another user.>>Using [random] won't work because there's a chance that the same random>number might come up again, and this solution has to guarantee *absolute*>uniqueness no matter what.>>How does the [cart] tag do it? Maybe I can use a similar technique. The>result must be no more than 12 characters in length, thus the reason I>cannot use the [cart] tag in this situation ...>>Sincerely,>Ken Grome
Associated Messages, from the most recent to the oldest:
I was thinking about the same problem a few weeks ago. I was going to tryand use a combination of days/hours/mins/secs to establish a start value,then multiply that value times ten and then add a random number formattedto two digits. So that the result would be:days/hours/minsXX where xx would come from the random function. Is thatachievable?Math functions always tax my feeble mind so I havn't gotten around toactually writing the WebDNA and trying this idea out.Marty SchmidArtwerks>I can use the number of days/hours/mins/secs in some form or other to>create a *nearly* unique identifier number for each user, but how do I>create a truly unique value for two people who access the site during the>exact same second in time?>>It seems both of these users will have the exact same value, so it won't>be unique -- unless I tack on some kind of sequential index number that>simply cannot be re-used again during the same second in time, even by>another user.>>Using
[random] won't work because there's a chance that the same random>number might come up again, and this solution has to guarantee *absolute*>uniqueness no matter what.>>How does the
[cart] tag do it? Maybe I can use a similar technique. The>result must be no more than 12 characters in length, thus the reason I>cannot use the
[cart] tag in this situation ...>>Sincerely,>Ken Grome
Marty Schmid
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:
New Guestbook Source (1997)
PROBLEM (1997)
[WebDNA] Databases not staying open (2010)
WebSTAR and WebSTAR/SSL with WebCatalog plugins (1998)
Writing [raw] to a file (2000)
Renumbering/changing sort order of lineitems (2004)
WC2b15 File Corruption (1997)
GuestBook example (1997)
[OT] Authorize.net (2003)
WebCatalog 4.0.1 has been released! (2000)
Waitfor file (2000)
Problems setting MIME Headers (1998)
WebCat on Alpha? (1997)
WebCatalog Mac 2.1b3 (1997)
problems with 2 tags (1997)
Further tests with the infamous shipCost (1997)
Document Contains No Data! (1997)
[WriteFile] problems (1997)
Math, Multiple Equasions and Show/Hide (1998)
Shopping problems with 2.1b3 acgi (1997)