Re: [WebDNA] SWITCH/CASE or SHOWIF

This WebDNA talk-list message is from

2008


It keeps the original formatting.
numero = 101487
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. > > > 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 [!] [/!] > > > 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. > > > 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 [!] [/!] > > > 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. > Govinda

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:

WebTrends (2002) [WebDNA] New request for websites that currently run WebDNA (2009) I'm new be kind (1997) [WebDNA] [OT] Updated (unofficial) WPT 2.0 (2014) determining plug-ins? (1998) looping table rows (1999) Alternating BGColors in Table Rows (1998) Accented chars and emailer (1998) Database Sizes (2000) Search Command, multiple dbs, etc. --Right! (2000) Sort Order on a page search (1997) Adding Message to Order (1997) Authorize.net, SIM, tcpconnect and applescript (2003) Cookie Question (1999) Re: (1997) Wanted: More Math Functions (or, Can You Solve This?) (1997) [WebDNA] Successful, working WebDNA7/CentOS install? (2013) Snake Bites (1997) Version f1 status (1997) Trouble with formula.db (1997)