Re: randomness
This WebDNA talk-list message is from 1997
It keeps the original formatting.
numero = 14542
interpreted = N
texte = This is exactly what the random sorting order is for. For example, if you have a field named category, and the category you are matching is YOGURT, then it might look like:eqCATEGORYdatarq=YOGURT&raCATEGORYsort=1&max=1This will return one random record from the specified category.John.>I want to be able to pull a random item from a specific category in my>product database. (bcxprod.txt)>I'm thinking of somehow using the [random] function and a [showif] to an>[index] of the [founditems] but I'm not sure how to also limit this to one>specific category. Also, some categories may only have 13 items? but the>[random] tag is from 1 - 100. Using a showif in this case could lead to a>blank spot on my rendered webpage. John A. HillPacific Coast Softwarehttp://www.smithmicro.com
Associated Messages, from the most recent to the oldest:
This is exactly what the random sorting order is for. For example, if you have a field named category, and the category you are matching is YOGURT, then it might look like:eqCATEGORYdatarq=YOGURT&raCATEGORYsort=1&max=1This will return one random record from the specified category.John.>I want to be able to pull a random item from a specific category in my>product database. (bcxprod.txt)>I'm thinking of somehow using the
[random] function and a
[showif] to an>[index] of the
[founditems] but I'm not sure how to also limit this to one>specific category. Also, some categories may only have 13 items? but the>
[random] tag is from 1 - 100. Using a showif in this case could lead to a>blank spot on my rendered webpage. John A. HillPacific Coast Softwarehttp://www.smithmicro.com
John Hill
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:
A question on sub-categories (1997)
ARGH! (2004)
Grep Question (2003)
This is a Test, sorry (1999)
Upgrade to web DNA6.0 (2004)
Recording size of uploaded file? (2001)
[include] (1998)
Upgrading old WebCat Database Files (1997)
Jimmy (1998)
WebCat editing, SiteGuard & SiteEdit (1997)
Linked lists and Recursive searching (2003)
Hiding Brands (2004)
Fufillment e-mail? (1998)
WebCat & Liststar (1997)
Encryption method used for [encrypt]? (2000)
[AppendFile] problem (WebCat2b13 Mac .acgi) (1997)
Multiple Passwords (1997)
brain teaser with an advanced search (2001)
Multiple prices (1997)
purchase plugin (1996)