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.com Well, the deal about switch / Break is that it is useful perhaps in PHP because one can have complex regex matches... where WebDNA's switch 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 of a 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] would make more sense. Donovan -- Donovan Brooke WebDNA Software Corporation http://www.webdna.us **[Square Bracket Utopia]** Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] opinions on [switch] [case]... (Donovan Brooke 2009)
  2. Re: [WebDNA] opinions on [switch] [case]... (Kenneth Grome 2009)
  3. Re: [WebDNA] opinions on [switch] [case]... (Govinda 2009)
  4. Re: [WebDNA] opinions on [switch] [case]... (Kenneth Grome 2009)
  5. [WebDNA] opinions on [switch] [case]... (Govinda 2009)
  6. [WebDNA] opinions on [switch] [case]... (Govinda 2009)
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.com Well, the deal about switch / Break is that it is useful perhaps in PHP because one can have complex regex matches... where WebDNA's switch 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 of a 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] would make more sense. Donovan -- Donovan Brooke WebDNA Software Corporation http://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:

Location of Webcat site in folder hierarchy (1997) Spreadsheet Interface. (1998) WebCat 4.0 (2000) Store results of GetChars? (2003) Running _every_ page through WebCat ? (1997) WebCat2b15MacPlugin - showing [math] (1997) WC2.0 Memory Requirements (1997) WebTV problems with WebCatalog?? (1998) Webcat 2.0.1b1 bug with IE 3.01/4.0p1 (1997) PC Cookie Problem? (2003) WebCat2: Found Items syntax, etc. (1997) Need help... (1997) Re2: frames & carts (1997) problems with 2 tags shakur (1997) strange IE 4.0 (1998) Deleting Orders (1997) WebCat2b12 - nesting [tags] (1997) pop up menu's (1998) Modtime bug? (2002) 2nd WebCatalog2 Feature Request (1996)