|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Too many case conditions?I am working on a CF 2.0 PPC app that utilizes a treview control. Depeding
on what node is clicked, a user control is loaded and displayed. I am loading the user control using a select case. So far there about 10 cases. Is that too many? Is there such a thing as too many cases? Thanks Ashok The more cases, the greater the possibility of a slower response time for
this case statement, but is there an actual limit to the amount of cases you can have? Not, that I'm aware of. 10 is certainly not too many. Show quoteHide quote "Showjumper" <dfgkjhdf> wrote in message news:%23JDDpKGFGHA.2708@TK2MSFTNGP11.phx.gbl... > > I am working on a CF 2.0 PPC app that utilizes a treview control. Depeding > on what node is clicked, a user control is loaded and displayed. I am > loading the user control using a select case. So far there about 10 cases. > Is that too many? Is there such a thing as too many cases? > > Thanks > Ashok > > Note that you should set the case that is believed to take place the most
as the first case also a good aproach might be to use at a certain point nested cases when a situation takes place after another should have been taken place by the way a select case is almost always faster as nested if then else statements if you use the above described aproach it is always the fastest aproach :-) regards Michel Posseth [MCP] Show quoteHide quote "Showjumper" <dfgkjhdf> wrote in message news:%23JDDpKGFGHA.2708@TK2MSFTNGP11.phx.gbl... > > I am working on a CF 2.0 PPC app that utilizes a treview control. Depeding > on what node is clicked, a user control is loaded and displayed. I am > loading the user control using a select case. So far there about 10 cases. > Is that too many? Is there such a thing as too many cases? > > Thanks > Ashok > > Hi Ashok,
No, 10 cases are not too many, and as long as they don´t contain expressions that must be evaluated they are quite fast. -- Show quoteHide quoteBest regards, Carlos J. Quintero MZ-Tools: Productivity add-ins for Visual Studio 2005, Visual Studio .NET, VB6, VB5 and VBA You can code, design and document much faster in VB.NET, C#, C++ or VJ# Free resources for add-in developers: http://www.mztools.com "Showjumper" <dfgkjhdf> escribió en el mensaje news:%23JDDpKGFGHA.2708@TK2MSFTNGP11.phx.gbl... > > I am working on a CF 2.0 PPC app that utilizes a treview control. Depeding > on what node is clicked, a user control is loaded and displayed. I am > loading the user control using a select case. So far there about 10 cases. > Is that too many? Is there such a thing as too many cases? > > Thanks > Ashok > >
Printing an ASP.NET web page from VB.NET - (HTTPWebResponse + Printing)
2 keys pressed at once Namespace around API calls Virtual Serial Port Bluetooth System.IO.Ports .Net 2.0 - Webbrowser control flickering on resize.... Loading UserControl on a ShowDialog Form sequence strange rotate gdi object Access SubQuery Help Needed..................... copying a collection ListView vs. ListBox in my Program |
|||||||||||||||||||||||