Re: [WebDNA] SWITCH/CASE or SHOWIF
This WebDNA talk-list message is from 2008
It keeps the original formatting.
numero = 101490
interpreted = N
texte = On Nov 20, 2008, at 1:39 PM, Ki Song wrote:>>> 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?No. Just make sure you only use line breaks this way (when you decide to comment them out w/WebDNA) where/when they border/touch the *value* of a tag's parameter, as opposed to trying to break up the parameter's name. It's kind if like webdna is forgiving when/where it still has no idea what you are going to stick in for the param's value... but is less forgiving where it fully well knows how it's tag's params are defined.Post a snip of your code where you are contemplating this and I can show you what I mean.>
Associated Messages, from the most recent to the oldest:
On Nov 20, 2008, at 1:39 PM, Ki Song wrote:>>> 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?No. Just make sure you only use line breaks this way (when you decide to comment them out w/WebDNA) where/when they border/touch the *value* of a tag's parameter, as opposed to trying to break up the parameter's name. It's kind if like webdna is forgiving when/where it still has no idea what you are going to stick in for the param's value... but is less forgiving where it fully well knows how it's tag's params are defined.Post a snip of your code where you are contemplating this and I can show you what I mean.>
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:
ShowNext (1997)
emailer error -108 (1997)
Need WebDNA that crashes server for testing (2000)
WebCat2b15MacPlugIn - [authenticate] not [protect] (1997)
Calendar using WebCatalog? (1997)
Database Advice (1996)
[WebDNA] random blank results? how come? (2014)
ooops...WebCatalog [FoundItems] Problem - LONG - (1997)
Google Web Accelerator (2005)
Setting up shop (1997)
MySQL blob question, Netscape slow question (2002)
[WebDNA] error on mirror site (2015)
Return records from another (1997)
send mail problem? (1997)
How do you TEAM Code? (2004)
Protect vs Authenicate (1997)
docs for WebCatalog2 (1997)
WebCat for Unix?? (1997)
Quit revisited (1997)
One more time (1997)