What is WebDNA

WebDNA is a scripting and database system designed to easily build web applications.

WebDNA and BioType

BioType service is a biometric keystroke dynamic system. It will be part of WebDNA 8.5

Download WebDNA

Download WebDNA freeware, try it and register later if you want.

WebDNA resources

The list of all WebDNA instructions.
WebDNA
Software Corporation
Search WebDNA Site
 Menu


HOME


DOWNLOADS


LEARN


EDUCATION


NEWS


COMMUNITY


STORE


SUPPORT


CONTACT

Re: Trying to loop for letters

This WebDNA talk-list message is from

1999


It keeps the original formatting.
numero = 23696
interpreted = N
texte = >I'm wondering what the best method would be to generate a heading at the top >of a results page that gives a listing of the letters in the alphabet as >anchored links (like the results page for http://maps.nemonline.org/). It's >a no brainer to just put a hard coded list there but how would I go about >only listing the letters that have results in the search, and then break up >the listing into the alphabetical sections. Is this the kind of thing that >would require 26 showifs at the top of the page setting variables and then >26 more showifs in the listing or is there a more elegant way?It's pretty tough to know exactly which letters were found in a search, because you'd have to visit each [founditem] in order to test it. But it's do-able if you don't mind a little extra work. The idea is to create a small database of 26 letters where each record indicates how many were found of that letter. Then zip thru the [founditems] and do a replace/increment for each matching letter.-- letters.db -- Letter HowMany A 15 B 3 C 0 ..... Z 2So of course you'd first need to clear out any old entries in the database with [Replace db=letters.db&neLetterdata=[blank]]HowMany=0[/Replace]Then you'd loop thru the [Founditems] and check the first letter of the result field and increment by 1 (any unusual carriage returns here are artifacts of this email,and should not be copied verbatim)[FoundItems] [text]theLetter=[GetChars start=1&end=1][YOURFIELD][/GetChars][/text] [Replace db=letters.db&eqLetterdata=[theLetter]]HowMany=[Math][Lookup db=letters.db&lookInField=Letter&value=[theLetter]]+1[/Math][/Replace] [/FoundItems]Now you've got a letters.db database you can use to display your hyperlink list with, and the added benefit of knowing exactly how *many* are in each section as well!Technical Support | ==== eCommerce and Beyond ==== Pacific Coast Software | WebCatalog, WebMerchant, 11770 Bernardo Plaza Court | SiteEdit Pro, PhotoMaster, San Diego, CA 92128 | Typhoon 619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Trying to loop for letters (PCS Technical Support 1999)
  2. Re: Trying to loop for letters (Joseph Pugh 1999)
  3. Re: Trying to loop for letters (Joseph Pugh 1999)
  4. Re: Trying to loop for letters (Joseph Pugh 1999)
  5. Trying to loop for letters (Mike_Davis 1999)
>I'm wondering what the best method would be to generate a heading at the top >of a results page that gives a listing of the letters in the alphabet as >anchored links (like the results page for http://maps.nemonline.org/). It's >a no brainer to just put a hard coded list there but how would I go about >only listing the letters that have results in the search, and then break up >the listing into the alphabetical sections. Is this the kind of thing that >would require 26 showifs at the top of the page setting variables and then >26 more showifs in the listing or is there a more elegant way?It's pretty tough to know exactly which letters were found in a search, because you'd have to visit each [founditem] in order to test it. But it's do-able if you don't mind a little extra work. The idea is to create a small database of 26 letters where each record indicates how many were found of that letter. Then zip thru the [founditems] and do a replace/increment for each matching letter.-- letters.db -- Letter HowMany A 15 B 3 C 0 ..... Z 2So of course you'd first need to clear out any old entries in the database with [Replace db=letters.db&neLetterdata=[blank]]HowMany=0[/Replace]Then you'd loop thru the [founditems] and check the first letter of the result field and increment by 1 (any unusual carriage returns here are artifacts of this email,and should not be copied verbatim)[founditems] [text]theLetter=[GetChars start=1&end=1][YOURFIELD][/GetChars][/text] [Replace db=letters.db&eqLetterdata=[theLetter]]HowMany=[math][Lookup db=letters.db&lookInField=Letter&value=[theLetter]]+1[/Math][/Replace] [/FoundItems]Now you've got a letters.db database you can use to display your hyperlink list with, and the added benefit of knowing exactly how *many* are in each section as well!Technical Support | ==== eCommerce and Beyond ==== Pacific Coast Software | WebCatalog, WebMerchant, 11770 Bernardo Plaza Court | SiteEdit Pro, PhotoMaster, San Diego, CA 92128 | Typhoon 619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com/ PCS Technical Support

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:

HTTP header line is too long? (1997) HELP!! problems with e-mail from WebCAT (1998) Generating unique SKU from [cart] - Still Stumped... (1997) WebCatalog and WebTen (1997) Looking for a Manual (1997) OT : Virus (2000) replacing items in a db (2000) This list needs a digest: rant, rave... (1997) Running 2 two WebCatalog.acgi's (1996) RE:math context ignores date prefs? (1998) Sorting ip addresses (2002) WCS Newbie question (1997) foreign languages, email, webcat (1998) Date search bug (1998) Groups doesn't work (1997) Communigate+Webcat (2001) WebCat2b13MacPlugIn - syntax to convert date (1997) WebCatalog Hosting (1996) [lookup] again... (2003) Mass deletion of records (2006)