Re: Case statement
This WebDNA talk-list message is from 2003
It keeps the original formatting.
numero = 53151
interpreted = N
texte = OK maybe a slight shift sideways - If I need to check for any of 3 or morepossible things within a variable like for example..com..net..co.uk..bizLets say for .com, .net and .org I do one thing, for .co.uk, .org.uk I doanother, for .biz I do a third thing and for .info another how would I doit.I tried [case value^.com] but it doesn't seem to respond to anything otherthan =. I could use [if][then] etc but since their is no [elseif] that wouldget very messy.I don't really want[case value=.com] whole heap of code[/case][case value=.net] same piece of code[/case]......And so on...Any help much appreciated========================================Steve Craig - Asylum Interactive LtdTel +44 1224 642960 Fax +44 1224 642962========================================http://www.asylumweb.comEmail: steve@asylumweb.com========================================> From: John Peacock
> Reply-To: (WebDNA Talk)> Date: Fri, 26 Sep 2003 12:09:00 -0400> To: (WebDNA Talk)> Subject: Re: Case statement> > Steve Craig wrote:>> [text show=T]myDomain=[Middle>> StartAfter=.&EndBefore=][DOMAIN][/middle][/text]>> >> [Switch value=[myDomain]]>> [Case value=com]>> [FuncNameA domain=[domain]]>> [/Case]>> [Case value=net]>> [FuncNameB domain=[domain]]>> [/Case]>> [Case value=org]>> [FuncNameC domain=[domain]]>> [/Case]>> [Default]>> Whatever I want in here>> [/Default]>> [/Switch] >> > > You can test the [switch] by hardcoding [mydomain] to something and make sure> that works, first. Then you need to make sure that your [function]> declarations > are active in the page (take that call out of the [switch] statement.> Finally, > if all that works, there is a bug with [function] and [switch]...> > 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/> -------------------------------------------------------------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:
OK maybe a slight shift sideways - If I need to check for any of 3 or morepossible things within a variable like for example..com..net..co.uk..bizLets say for .com, .net and .org I do one thing, for .co.uk, .org.uk I doanother, for .biz I do a third thing and for .info another how would I doit.I tried [case value^.com] but it doesn't seem to respond to anything otherthan =. I could use [if][then] etc but since their is no [elseif] that wouldget very messy.I don't really want[case value=.com] whole heap of code[/case][case value=.net] same piece of code[/case]......And so on...Any help much appreciated========================================Steve Craig - Asylum Interactive LtdTel +44 1224 642960 Fax +44 1224 642962========================================http://www.asylumweb.comEmail: steve@asylumweb.com========================================> From: John Peacock > Reply-To: (WebDNA Talk)> Date: Fri, 26 Sep 2003 12:09:00 -0400> To: (WebDNA Talk)> Subject: Re: Case statement> > Steve Craig wrote:>> [text show=T]myDomain=[Middle>> StartAfter=.&EndBefore=][DOMAIN][/middle][/text]>> >> [Switch value=[myDomain]]>> [Case value=com]>> [FuncNameA domain=[domain]]>> [/Case]>> [Case value=net]>> [FuncNameB domain=[domain]]>> [/Case]>> [Case value=org]>> [FuncNameC domain=[domain]]>> [/Case]>> [Default]>> Whatever I want in here>> [/Default]>> [/Switch] >> > > You can test the [switch] by hardcoding [mydomain] to something and make sure> that works, first. Then you need to make sure that your [function]> declarations > are active in the page (take that call out of the [switch] statement.> Finally, > if all that works, there is a bug with [function] and [switch]...> > 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/> -------------------------------------------------------------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/
Steve Craig
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:
Trouble with formula.db (1997)
WebCat2 - Getting to the browser's username/password data (1997)
MacWEEK article help needed (1996)
docs for WebCatalog2 (1997)
ODBC problems between webcatalog and filemaker pro (2001)
[WebDNA] Syntax Error? (2009)
Closing databaes (2002)
Questions (1998)
Duplicate Messages (1998)
WebDNA performance comparisons? (2004)
More on the email templates (1997)
auto adding SKUs w/DB helper (1998)
[WebDNA] MD5 Hash issue (2009)
quantity minimum problem (1997)
Date search bug (1998)
Help name our technology! (1997)
WebCat2final1 crashes (1997)
Multiple searches on a single page / random record from full database? (1999)
Ampersands in database fields? (1998)
Speed Admin? (Was FlushDatabases) (1997)