Cassio Posted July 6, 2003 Posted July 6, 2003 Is there a way I can use the Like operator in a select case stetement? I want it to have the same effect of statement below: If m Like "200*" then 'code Elseif m Like "test*" then 'code end if But there are many conditions to test and the select case would look better. Thanks. Quote Stream of Consciousness (My blog)
*Experts* Volte Posted July 7, 2003 *Experts* Posted July 7, 2003 Select Case True Case m Like "200*" 'code Case m Like "test*" 'code End SelectThat's really the only way to do it. Not much different than the If block really. Quote
Cassio Posted July 7, 2003 Author Posted July 7, 2003 Thanks VolteFace! Do you know if there´s a performance diference in using the select-case or the if-then-elseif? Quote Stream of Consciousness (My blog)
Leaders Iceplug Posted July 8, 2003 Leaders Posted July 8, 2003 I doubt there's any performance difference... both of these will check for a True condition, run specified code, and exit the entire block. Personally, I use Select Case for selecting from a list of choices of a datatype, and otherwise, If statements. :) Quote Iceplug, USN One of my coworkers thinks that I believe that drawing bullets is the most efficient way of drawing bullets. Whatever!!! :-(
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.