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. 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:
wc 2 pro users - sites, quotes wanted (1997)
[BoldWords] WebCat.acgib15Mac (1997)
Help! Strange happenings... (1997)
Validating a date (2000)
Cart Unique After Rolling Back Time? (2001)
year 2000 + and webmerch, macauth? (1998)
Not really WebCat (1997)
PCS Emailer's role ? (1997)
carriage returns in data (1997)
WebCat chatroom (1997)
WebCat 5 Intranet Question (2003)
[listfields] on Mac OS w/WC 3.x (2001)
WCS Newbie question (1997)
Can you do this??? and other stuff (1997)
[SearchString] problem with [search] context (1997)
SMSI -- a [notfound] context? (2002)
Price and Formula.db (2002)
Problem with order processing (2006)
PDF Tools (2006)
Roundup function? (1997)