Re: Unique Sort

This WebDNA talk-list message is from

2003


It keeps the original formatting.
numero = 48457
interpreted = N
texte = stephen wrote: > How can sort my results in the following format: > > 3 > 3M > 3M Visual Systems Division > > A > Acer Latin America > Apricorn Mass Storage > > B > Belkin Components > Brother Int'l (printers) > No tested code, just ideas...First, do a summary sort on whatever field you are talking about. Next, create a text variable for the header and set it to blank. Then, in the [founditems] loop, grab the first character of the next record and see if it is the same as the existing header value; if not, set the header value to be that new character and do whatever formatting you want to seperate the sections.Sort of like this:[search db=blah&so-on] [text]heading=[/text] [founditems] [if [heading]![getchars start=1&end=1][yourfield][/getchars]] [text]heading=[getchars start=1&end=1][yourfield][/getchars][/text]

[heading] [/if] [yourfield] [/founditems] [/search]HTHJohn-- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4501 Forbes Boulevard Suite H Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5748 ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Unique Sort (stephen 2003)
  2. Re: Unique Sort (John Peacock 2003)
  3. Re: Unique Sort (stephen 2003)
  4. Re: Unique Sort (stephen 2003)
  5. Re: Unique Sort (John Peacock 2003)
  6. Unique Sort (stephen 2003)
stephen wrote: > How can sort my results in the following format: > > 3 > 3M > 3M Visual Systems Division > > A > Acer Latin America > Apricorn Mass Storage > > B > Belkin Components > Brother Int'l (printers) > No tested code, just ideas...First, do a summary sort on whatever field you are talking about. Next, create a text variable for the header and set it to blank. Then, in the [founditems] loop, grab the first character of the next record and see if it is the same as the existing header value; if not, set the header value to be that new character and do whatever formatting you want to seperate the sections.Sort of like this:[search db=blah&so-on] [text]heading=[/text] [founditems] [if [heading]![getchars start=1&end=1][yourfield][/getchars]] [text]heading=[getchars start=1&end=1][yourfield][/getchars][/text]

[heading] [/if] [yourfield] [/founditems] [/search]HTHJohn-- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4501 Forbes Boulevard Suite H Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5748 ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ John Peacock

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:

minimalist shopping cart. (1997) WebCat2b13MacPlugIn - more [date] problems (1997) extending webcatalog (1997) WC2.0 Memory Requirements (1997) How To question on setting up downloads (1997) New reserved words for [tags] (2000) Problems with [Applescript] (1997) listfiles-looking for slick solution (1997) WebCatalog dying in NT (1998) Shownext never shows next...still (1997) Projects & Contractors (1997) Shorthand for command args (1998) Re1000001: Setting up shop (1997) credit card (1997) [WebDNA] WebDNA 7 and Deprecated command (2011) RE: Migrating to NT (1997) Country & Ship-to address & other fields ? (1997) getchars broken? (1997) Unix line endings (2003) ampersand in a sendmail body (2007)