Quick question: Is it possible to use a <CFCASE VALUE="..."> where "value" is a range of numbers, or are ranges only possible with <CFIF>?
I don't think so, to my understanding the values in the <CFCASE> tag must be a constant value, you can't even use a CF variable in the CFCASE, it must be a "constant value".
You could do <CFCASE VALUE="1,2,3,4,... all the way to.. 98,99">, but that would be a pain.
I'd say your better alternative would to use <CFIF>.
- tleish
I knew you could use <CFIF> within <CFCASE> but if you're going to do that, aren't you losing most of what makes <CFSWITCH> more efficient?
I prefer <CFSWITCH> in most situations because it's reported to be more efficient than several <CFIF> statements. If I were to use the two together, how would I benefit? Is there any added value to putting <CFIF> inside a <CFSWITCH> statement? It actually ends up being more code. Kevin
slanek@ssd.fsi.com
I actually just bought a pretty good book that details this: "Mastering Coldfusion 4.5" by Arman Danesh and Kristin Aileen Motlagh. I would highly recommend picking up a copy for reference.
Oooo, yuk. Hadn't considered that. In that case,it would probably behoove you to use a [cfif #value# gt 0 and #value# lt 10000], which of course could be complicated if your values range from 1 to 10,000, but don't include ALL values between 1 and 10,000.
So, in a nutshell, um, good luck? Let us know if you find anything. {
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.