Re: [WebDNA] [listwords] and [index]

This WebDNA talk-list message is from

2009


It keeps the original formatting.
numero = 103192
interpreted = N
texte = Rich Kwas wrote: > I indicate if an item has reviews at a review site this way in a db: > +rsite1+rsite4+rsite5+rsite7+ > > I want to show one text string if the field contains 1 or 2 entries, and a different text string if it contains 3 or more entries. > > Can I use [listwords] with [index] ??? > > I've been trying this and variations of it but no real success so far: > > [listwords words=[reviewsites]&delimiters=+] > [showif [index]<=[math]2[/math]]one text line[/showif] > [showif [index]>=[math]3[/math]]another text line[/showif] > [/listwords] > > I'm thinking it's because [index] just counts the lines?? [text]tCount=0[/text] [listwords words=[reviewsites]&delimiters=+] [text]tcount=[math][tCount]+1[/math][/text] [/listwords] [showif [tcount]<3] something [/showif] [showif [tcount]>2] something else [/showif] > I thought [countwords] could do the trick but I always get "1" as a result: > [CountWords Delimiters=+][reviewsites][/CountWords] > > Is "+" not an accepted Delimiter in Countwords? For countwords... http://docs.webdna.us/ Donovan -- Donovan Brooke WebDNA Software Corporation http://www.webdna.us **[Square Bracket Utopia]** Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] [listwords] and [index] (Rich Kwas 2009)
  2. Re: [WebDNA] [listwords] and [index] (John Butler 2009)
  3. Re: [WebDNA] [listwords] and [index] (Donovan Brooke 2009)
  4. Re: [WebDNA] [listwords] and [index] (Donovan Brooke 2009)
  5. Re: Re: [WebDNA] [listwords] and [index] ( 2009)
  6. Re: [WebDNA] [listwords] and [index] ( 2009)
  7. [WebDNA] [listwords] and [index] (Rich Kwas 2009)
Rich Kwas wrote: > I indicate if an item has reviews at a review site this way in a db: > +rsite1+rsite4+rsite5+rsite7+ > > I want to show one text string if the field contains 1 or 2 entries, and a different text string if it contains 3 or more entries. > > Can I use [listwords] with [index] ??? > > I've been trying this and variations of it but no real success so far: > > [listwords words=[reviewsites]&delimiters=+] > [showif [index]<=[math]2[/math]]one text line[/showif] > [showif [index]>=[math]3[/math]]another text line[/showif] > [/listwords] > > I'm thinking it's because [index] just counts the lines?? [text]tCount=0[/text] [listwords words=[reviewsites]&delimiters=+] [text]tcount=[math][tCount]+1[/math][/text] [/listwords] [showif [tcount]<3] something [/showif] [showif [tcount]>2] something else [/showif] > I thought [countwords] could do the trick but I always get "1" as a result: > [CountWords Delimiters=+][reviewsites][/CountWords] > > Is "+" not an accepted Delimiter in Countwords? For countwords... http://docs.webdna.us/ Donovan -- Donovan Brooke WebDNA Software Corporation http://www.webdna.us **[Square Bracket Utopia]** Donovan Brooke

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:

[WebDNA] PayPal Instant Payment Notification Guide (2009) Don't know if this is a sily question... (2003) [SearchString] problem with [search] context (1997) One other big addition... (1997) Protecting databases (1999) Help! WebCat2 bug (Ben's input) (1997) [SearchString] usage (1997) WebCatalog can't find database (1997) Summary search -- speed (1997) 5.0 Pricing (2003) 2.0 Info (1997) Re:2nd WebCatalog2 Feature Request (1996) using showpage and showcart commands (1996) creating files dynamically (2002) Generating Report Totals (1997) really wierd browser truncating (1997) t or f (1997) Plugin vs. CGI (1998) 5.0: Blank shopping carts & other weirdness (2003) Help name our technology! (1997)