James wrote:
>Uhm.. If..elseif..elseif..elseif..etc..else..endif
and
>CFMX has the same "problem".

And rest assured it is a problem that is not afflicted on every language.  I posted a 
feature request for this functionality and some others to Macromedia and it didn't get 
anywhere.  My impression was the speed of the tag would have been degraded in this 
environment if such a feature had been added.  Shame because it is incredibly powerful.

Lets say, for example, you have a chunk of code that has to branch in one of 50 
directions, and those directions are variable depending on stuff that happened further 
up the pipe.  

Compare the exercution time of hobbling thru 50 elseifs versus one case statement 
where the only code that gets executed is the case you need at the moment.

Or wouldn't it be nice to be able to code this:

select case zipcode%
  case 93701:territory%=1
  case is 93702 to 93750:territory%=2
  case is 93751, 93752, 93754, 93755 to 94900:territory%=3
  case > 94901:territory%=4
  case else:territory%=5
end case

Can you write this some other way?  Yes.  As elegantly?  I had to translate an 
insurance company's entire rating system into CF and I sorely missed the ability to 
use variables and ranges in case statements.  So would you if you had the opportunity 
to use them.

I'd like to see something like this in CF still.  Never mind the speed.  Look at the 
functionality.

-------------------------------------------
 Matt Robertson,     [EMAIL PROTECTED]
 MSB Designs, Inc. http://mysecretbase.com
-------------------------------------------

 
             
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to