What is WebDNA

WebDNA is a scripting and database system designed to easily build web applications.

WebDNA and BioType

BioType service is a biometric keystroke dynamic system. It will be part of WebDNA 8.5

Download WebDNA

Download WebDNA freeware, try it and register later if you want.

WebDNA resources

The list of all WebDNA instructions.
WebDNA
Software Corporation
Search WebDNA Site
 Menu


HOME


DOWNLOADS


LEARN


EDUCATION


NEWS


COMMUNITY


STORE


SUPPORT


CONTACT

Re: Switch Case Context

This WebDNA talk-list message is from

2004


It keeps the original formatting.
numero = 58540
interpreted = N
texte = on 6/22/2004 2:07 pm, devaulw@onebox.com at devaulw@onebox.com so noted... > Is there anyway to get the switch/case context to work like this (pseudo-code > follows): > [switch value=X] > [CASE value>10] A [/CASE] > [CASE value>5] B [/CASE] > [CASE value=4] C [/CASE] > [CASE value=TEXT] TEXT [/CASE] > [DEFAULT] D [/DEFAULT] You could set values based on these conditions, then perform the case based upon those. If your goal is just to set values, you don't need the [switch]. [text]theValue=D[/text] [text]numberX=[grep search=[^0-9\.-]&replace=][X][/grep][/text] [showif [numberX]>5][text]theValue=B[/text][/showif] [showif [numberX]>10][text]theValue=A[/text][/showif] [showif [numberX]=4][text]theValue=C[/text][/showif] [showif [X]=TEXT][text]theValue=TEXT[/text][/showif] [switch value=[theValue]] [case value=A] do A [/case] [case value=B] do B [/case] [case value=C] do C [/case] [case value=TEXT] do TEXT [/case] [case value=D] do D [/case] [/switch] The grep is used to give more reliable results when values other than the literal string "TEXT" are entered. There could still be unexpected results for an entry of, say "cheese 4"... but then, you're the one comparing both text and numeric values in the same field. ; ) Rob Marquardt Designer/Resident Wirehead Toast Design 800 Washington Avenue North Minneapolis MN 55401 612.330.9863 v 612.321.9424 f www.toastdesign.com ------------------------------------------------------------- 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: Switch Case Context ( Rob Marquardt 2004)
  2. Re: Switch Case Context ( John Peacock 2004)
  3. Switch Case Context ( devaulw@onebox.com 2004)
on 6/22/2004 2:07 pm, devaulw@onebox.com at devaulw@onebox.com so noted... > Is there anyway to get the switch/case context to work like this (pseudo-code > follows): > [switch value=X] > [CASE value>10] A [/CASE] > [CASE value>5] B [/CASE] > [CASE value=4] C [/CASE] > [CASE value=TEXT] TEXT [/CASE] > [DEFAULT] D [/DEFAULT] You could set values based on these conditions, then perform the case based upon those. If your goal is just to set values, you don't need the [switch]. [text]theValue=D[/text] [text]numberX=[grep search=[^0-9\.-]&replace=][X][/grep][/text] [showif [numberX]>5][text]theValue=B[/text][/showif] [showif [numberX]>10][text]theValue=A[/text][/showif] [showif [numberX]=4][text]theValue=C[/text][/showif] [showif [X]=TEXT][text]theValue=TEXT[/text][/showif] [switch value=[theValue]] [case value=A] do A [/case] [case value=B] do B [/case] [case value=C] do C [/case] [case value=TEXT] do TEXT [/case] [case value=D] do D [/case] [/switch] The grep is used to give more reliable results when values other than the literal string "TEXT" are entered. There could still be unexpected results for an entry of, say "cheese 4"... but then, you're the one comparing both text and numeric values in the same field. ; ) Rob Marquardt Designer/Resident Wirehead Toast Design 800 Washington Avenue North Minneapolis MN 55401 612.330.9863 v 612.321.9424 f www.toastdesign.com ------------------------------------------------------------- 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/ Rob Marquardt

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:

WebCat2b13MacPlugIn - [showif][search][/showif] (1997) Error: this shopping cart has already been submittedm (2004) counting characters and/or words (1997) [WebDNA] WebDNA code validator (2011) Message Boards (2003) Nested tags count question (1997) Crashes with recursion (2000) Universal root for WC errors? (1997) reverse of math value... (2004) Authorize net woes (2003) off topic - dna snipets (1997) where to put code (1998) textarea to page display (1998) webcat- multiple selection in input field (1997) Emailer port change (1997) Exclude by date - multiple (1997) hiding return characters (2000) Nested tags count question (1997) DON'T use old cart file! (1997) Simple Store (2000)