> >Can someone confirm that we cann't actually use variables in cfswitch > case values ??? > >I feel it is ridiculous.. What is the reasoning behind this if it si > true? > > > >I tried.. > > > ><cfcase value="#CONST1#">...</cfcase> > ><cfcase value="#CONST2#">...</cfcase> > > > >etc, where CONST1 and CONST2 are cfset in the application.cfm > > > >and it complains.. > > that sucks.. > > switch () in java allows constants to be used in case. I wish cf did > too... that blows.. Personally I think that makes cfswitch unusable > for the most part. Oh well, just my 2c worth of gripes.
Really? What's so difficult about a simple switch as in <cfswitch expression = "#variables.foo#> <cfcase value="one,two,three,etc.">do something</case> <cfdefaultCase>do something else</cfcase> </cfswitch> As for unusable, I find just the opposite, its one of the most useful tags. In a lot of coding, you're making decisions based on a single type of variable. If you're doing something more complex, that's when you need to use a <cfif foo>...<cfelseif bar>...<cfelse>...</cfif> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;203748912;27390454;j Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:310148 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

