Re: [WebDNA] SWITCH/CASE or SHOWIF

This WebDNA talk-list message is from

2008


It keeps the original formatting.
numero = 101488
interpreted = N
texte = >> 1. To go through 100 different choices, is a switch/case more >> efficient or 100 showif statements more efficient? > I dunno, I would guess that one switch case is faster; at least in other > languages, when you evaluate once instead of many times, it's faster. I guess the only way to find out is to test it. >> 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? > anywhere you don't want the line break to appear when webdna spite out > the html then just wrap it with the webdna comment tag, like this one [!] > [/!] Doesn't that prevent the DNA code from being evaluated? >> 3. Does a SWITCH/CASE statement create line breaks for all the cases >> that evaluate to false? > if it does , then try the trick I just mentioned. 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)
>> 1. To go through 100 different choices, is a switch/case more >> efficient or 100 showif statements more efficient? > I dunno, I would guess that one switch case is faster; at least in other > languages, when you evaluate once instead of many times, it's faster. I guess the only way to find out is to test it. >> 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? > anywhere you don't want the line break to appear when webdna spite out > the html then just wrap it with the webdna comment tag, like this one [!] > [/!] Doesn't that prevent the DNA code from being evaluated? >> 3. Does a SWITCH/CASE statement create line breaks for all the cases >> that evaluate to false? > if it does , then try the trick I just mentioned. 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:

Nesting format tags (1997) Setting up shop (1997) can you take a look (2003) Sales Tax db (1998) WebCat2.0 acgi vs plugin (1997) Errata: WCS Newbie question (1997) Off-Topic: Optimal WebSTAR settings for WebDNA plugin v4.5 (2002) Pull down menu for categories (2000) Range Comparisons (2000) SQLConnect to Oracle database (2004) Emailer again (1997) DNS Lookup 2 (2000) OT (maybe) Setting up local (non internet) test computers (2000) Intermitent problem using [referrer] (1997) WCS Newbie question (1997) TCPConnect / TCPSend to Solaris NN Enterprise (2002) [Fwd: Rotating Banners ... (was LinkExchange)] (1997) Review comparison by PC Magazine: Open for On-line Business (1997) First postarg not taking in $Commands (1997) WAP (2000)