Jochem van Dieten wrote: > How much does CF *really* need? Pseudocode: > <cfif variables.ZIPCode LT 93711> > ...blahblahblah... > <cfelseif mySwitch(variables.ZIPCode, "93712, 93713 TO 93940, 93950, 94086 TO >95050")> > ...blahblahblah... > <cfelseif variables.ZIPCode GT 93711> > ...blahblahblah... > </cfif> > You just have to write mySwitch() once and put that in your standard UDF > includefile.
Yes, I could write my own function (assuming I was on CF5+), and thats probably as good as CF can get at present, but I'm looking to see if native support for the feature is feasible. I had to build that app for 45 U.S. states, and while I know thats not a common occurrence, the point is it had already been done with thousands of fewer lines of more intuitive code... somewhere else. As RAD goes thats pretty rad, which is right up CF's alley. Can it be done in CF/BD? I haven't the foggiest idea. All I know is I've seen it done before and it works marvelously. > I always believed the whole point of a switch statement was that only > the switch side had to be evaluated as an expression and the case sides > were simple values, thereby greatly reducing the amount of processing. Well, of course, thats why I want the functionality in CFSWITCH in the first place. :) As we already know there are other ways to do it. Overhead on the cfcase statement might be increased since parameters might require more work to evaluate... there may be circumstances where the thing could be built so that complex needs aren't in the picture unless asked for expressly... but whether any of this would be a performance issue or not is to be determined. You never know if you never ask. --Matt-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm