Re: if else problem

This WebDNA talk-list message is from

2003


It keeps the original formatting.
numero = 54892
interpreted = N
texte = Kenneth Grome wrote: > By the way, I would like to provide one important word of warning here: I failed to reply to this when it was originally posted and I just noticed it still in my inbox. > > The way switch/case works in webdna is to display ALL the matching > cases, not just the first matching case. This is NOT the way > switch/case works in other popular software products! If you duplicate the [case] values (i.e. you wrote bad code), WebCat *will* execute the code in each matching block. I am unsure why returning only the first value is necessarily better; the code is badly written in the first place, and it shouldn't be the interpreter's business to infer what the programmer actually intended to happen. It is true that in C, the command 'break' will skip all remaining case branches. WebDNA is apparently implementing [switch]/[case] as if it were a series of [if] statements, rather than nested [if][else] blocks. If any software package silently ignores the second and subsequent [case] values, any code there is unreachable and effectively null. This is not a bug, as far as I am concerned. John -- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4501 Forbes Boulevard Suite H Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5748 ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: if else problem ( John Peacock 2003)
  2. Re: if else problem ( Brian Fries 2003)
  3. Re: if else problem ( Kenneth Grome 2003)
  4. Re: if else problem ( Brian Fries 2003)
  5. Re: if else problem ( "RichC" 2003)
  6. Re: if else problem ( Alan White 2003)
  7. Re: if else problem ( Kenneth Grome 2003)
  8. Re: if else problem ( Alan White 2003)
  9. Re: if else problem ( Rob Marquardt 2003)
  10. Re: if else problem :- Version1 ( Donovan Brooke 2003)
  11. Re: if else problem: Version 2 ( "Erol Guneri" 2003)
  12. Re: if else problem: Version 2 ( Alan White 2003)
  13. Re: if else problem :- Version1 ( Alan White 2003)
  14. Re: if else problem ( Donovan Brooke 2003)
  15. Re: if else problem ( Alan White 2003)
  16. Re: if else problem ( Gary Krockover 2003)
  17. Re: if else problem ( Alan White 2003)
  18. Re: if else problem ( Brian Fries 2003)
  19. Re: if else problem ( Brian Fries 2003)
  20. Re: if else problem ( Alan White 2003)
  21. Re: if else problem ( Brian Fries 2003)
  22. Re: if else problem ( "Erol Guneri" 2003)
  23. if else problem ( Alan White 2003)
Kenneth Grome wrote: > By the way, I would like to provide one important word of warning here: I failed to reply to this when it was originally posted and I just noticed it still in my inbox. > > The way switch/case works in webdna is to display ALL the matching > cases, not just the first matching case. This is NOT the way > switch/case works in other popular software products! If you duplicate the [case] values (i.e. you wrote bad code), WebCat *will* execute the code in each matching block. I am unsure why returning only the first value is necessarily better; the code is badly written in the first place, and it shouldn't be the interpreter's business to infer what the programmer actually intended to happen. It is true that in C, the command 'break' will skip all remaining case branches. WebDNA is apparently implementing [switch]/[case] as if it were a series of [if] statements, rather than nested [if][else] blocks. If any software package silently ignores the second and subsequent [case] values, any code there is unreachable and effectively null. This is not a bug, as far as I am concerned. John -- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4501 Forbes Boulevard Suite H Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5748 ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ John Peacock

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:

Auto Submit (2000) Re[3]: 2nd WebCatalog2 Feature Request (1996) WC TableGrinder (1997) Protect (1997) [WebDNA] anyone know why webdna kicking out incorrect dates? (2008) Search results templates (1996) THANKS (1997) Shopping Cart Questions (1998) Processing all html files through WebCat or Typhoon (1998) RE:It just Does't add up!!! (1997) Last desperate attempt (1998) Re[2]: 2nd WebCatalog2 Feature Request (1996) unitshipcost vs shipcosts (1997) Real Audio files (1997) New Mac Emailer... (1997) Rollovers (1999) Re:Can this be done? (1997) Banners and sort of random display (1997) "The event log file is corrupt" (2003) WebCatalog can't find database (1997)