Re: [WebDNA] opinions on [switch] [case]...
This WebDNA talk-list message is from 2009
It keeps the original formatting.
numero = 103837
interpreted = N
texte = Govinda wrote:>> So maybe all webdna needs is a break statement which it currently does >> not have. Actually it has one, but it only works for [loop] -- not >> for [switch].> > I always like to keep humble since there are always deeper-thinker coder > heads than me.. but I agree that if [switch] (in any language) is going > to go on executing cases after the first matching case, then there > really needs to be the ability to break out of that.> > ------------> Govinda> govinda.webdnatalk@gmail.comWell, the deal about switch / Break is that it is useful perhaps inPHP because one can have complex regex matches... where WebDNA'sswitch is very speedy in that in that it is a simple match.It also is not a loop... so in order for a [break] to show *any*speed improvement in switch.. you'd have to type out one heck ofa long manual switch context... and if you are going to do that, you might as well use [loop].. which already has a break.Something like:[loop start=1&end=10000000] [showif [url][interpret][var[index]][/interpret][/url]=somvalue]
[break] [/showif][/loop]I suppose if we ever replicate a PHP-like switch, [break] wouldmake more sense.Donovan-- Donovan BrookeWebDNA Software Corporationhttp://www.webdna.us**[Square Bracket Utopia]**
Associated Messages, from the most recent to the oldest:
Govinda wrote:>> So maybe all webdna needs is a break statement which it currently does >> not have. Actually it has one, but it only works for [loop] -- not >> for [switch].> > I always like to keep humble since there are always deeper-thinker coder > heads than me.. but I agree that if [switch] (in any language) is going > to go on executing cases after the first matching case, then there > really needs to be the ability to break out of that.> > ------------> Govinda> govinda.webdnatalk@gmail.comWell, the deal about switch / Break is that it is useful perhaps inPHP because one can have complex regex matches... where WebDNA'sswitch is very speedy in that in that it is a simple match.It also is not a loop... so in order for a [break] to show *any*speed improvement in switch.. you'd have to type out one heck ofa long manual switch context... and if you are going to do that, you might as well use [loop].. which already has a break.Something like:[loop start=1&end=10000000] [showif [url][interpret][var[index]][/interpret][/url]=somvalue] [break] [/showif][/loop]I suppose if we ever replicate a PHP-like switch, [break] wouldmake more sense.Donovan-- Donovan BrookeWebDNA Software Corporationhttp://www.webdna.us**[Square Bracket Utopia]**
Donovan Brooke
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:
Using tags to create a file name (2000)
Size images (2002)
Grep Ampersands (2008)
2.0 Info (1997)
Security Issue (1997)
with Link i need to (1997)
Extracting a Word (2000)
(1997)
WebCatalog NT beta 18 problem (1997)
Up and running ... at last !! (1997)
webcat2b12 CGI -- Date comparisons (1997)
Questions To Answer (1997)
WebCat2 Append problem (B14Macacgi) (1997)
Server crashes when user saves or views html source (1998)
Nested tags count question (1997)
formulas.db (1999)
Summarizing on two fields (1998)
WebCatalog as a ListServ (1998)
RE: E-mailer error codes (1997)
Using Applescript to process WebCatalog functions (1998)