[WebDNA] SWITCH/CASE or SHOWIF

This WebDNA talk-list message is from

2008


It keeps the original formatting.
numero = 101486
interpreted = N
texte = We have about a 100 different brands at our store. Some brands have "static" brand pages (brand/index.html) while others have "dynamic" brand pages (dynamic.tpl?brand=somebrand). 1. To go through 100 different choices, is a switch/case more efficient or 100 showif statements more efficient? 2. In the final generated HTML code, when 100 SHOWIF statements are processed, but only 1 is actually shown, the other 99 SHOWIF statements create line breaks. Is there a way to prevent the line breaks from showing up if a showif does not evaluate to true? 3. Does a SWITCH/CASE statement create line breaks for all the cases that evaluate to false? Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] SWITCH/CASE or SHOWIF (Ki Song 2008)
  2. Re: [WebDNA] SWITCH/CASE or SHOWIF ("Dan Strong" 2008)
  3. Re: [WebDNA] SWITCH/CASE or SHOWIF (Toby Cox 2008)
  4. Re: [WebDNA] SWITCH/CASE or SHOWIF (Govinda 2008)
  5. Re: [WebDNA] SWITCH/CASE or SHOWIF ("Dan Strong" 2008)
  6. Re: [WebDNA] SWITCH/CASE or SHOWIF (Ki Song 2008)
  7. Re: [WebDNA] SWITCH/CASE or SHOWIF (Govinda 2008)
  8. [WebDNA] SWITCH/CASE or SHOWIF (Ki Song 2008)
We have about a 100 different brands at our store. Some brands have "static" brand pages (brand/index.html) while others have "dynamic" brand pages (dynamic.tpl?brand=somebrand). 1. To go through 100 different choices, is a switch/case more efficient or 100 showif statements more efficient? 2. In the final generated HTML code, when 100 SHOWIF statements are processed, but only 1 is actually shown, the other 99 SHOWIF statements create line breaks. Is there a way to prevent the line breaks from showing up if a showif does not evaluate to true? 3. Does a SWITCH/CASE statement create line breaks for all the cases that evaluate to false? Ki Song

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:

Problem with textA (2000) [SHOWIF]s and empty arguments (1997) Deleting Multiple Database Records based on Checkbox (1998) WebCat2 - many [carts] on one template page? (1997) WebCat2b13MacPlugIn - [shownext method=post] ??? (1997) WC2.0 Memory Requirements (1997) emailer w/F2 (1997) Re:2nd WebCatalog2 Feature Request (1996) To Err or Not Custom Error (1999) Emailer Q (2002) WebDNA and Front Page Extensions (2002) [Webcat 2]Next (1997) Directory Overload (1998) Contribution (2000) Open Market's Transact & Macintosh (1998) Quickie question on the email templates (1997) greater than or equal to (1997) [date format] w/in sendmail (1997) F2 to F3 rocky transition (1997) Comments in db? (1997)